Part Number Hot Search : 
314008P PJQ5472A 127155MR PQ160 C1470 2SD16 25NF10 SMAJ58A
Product Description
Full Text Search
 

To Download 71M6521DE-IGTF Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  71m6521de /dh / fe energy meter ic s data sheet re v 2 page: 1 of 107 19 - 5370; rev 2; 1 1 /1 1 general description the teridian ? 71m6521de /dh /fe e nergy meter ic s are highly integrated system s-on -a - chip ( soc s) with an mpu core, rtc, flash, and lcd driver. the single converter technology ? with a 22 - bit delta- sigma adc, four analog inputs, digital temperature compensation, precision voltage reference, battery voltage monitor, and 32 - bit computation engine (ce) supports a wide range of residential metering applications with very few low - cost external com ponents. a 32khz crystal time base for the entire system and internal battery - backup support for ram and rtc further reduce system cost. the ic s support 2 - wire, 3 - wire , and 4 - wire single - phase and dual - phase residential metering along with ta mper - detection mechanisms. maximum design flexibility is provided by multiple uarts, i 2 c, microwire ? , up to 18 dio pins , and in - system programmable flash memory, which can be updated with data or application code in operation. a complete array of ice and development tools, programming libraries , and reference designs enable rapid development and certification of tou, amr , and p repay meters that comply with worldwide electricity metering standards. features ? up to 0. 1 % wh accuracy over 2000:1 current ran ge ? exceeds iec 62053/ansi c 12.20 st andards ? voltage re ference < 40 ppm/c (< 20 ppm/c for 71m6521dh) ? four sensor inp uts ?v dd r eferenced ? low - jitte r wh and varh pulse test ou tputs (10khz max ) ? pulse co unt for pulse ou tputs ? four - quadrant me terin g ? tamper d etection neutral cu rrent with ct or s hunt ? line frequency c ount for rtc ? digital temperature c ompensation ? sag d etection for p hase a and b ? independent 32 - bi t compute engi ne ? 46- 64hz line frequency ran ge with same ca libration ? phase c ompensation ( 7 ) ? battery backup for rtc and battery monitor ? three battery mo des with wake- u p on pus hbutton or ti mer: brownout m ode (48a) lcd m ode (5.7a) sleep m ode (2.9a) ? energy di splay on main power fa ilure ? wake- u p with p ushbutton ? 22- bit delta - sig ma adc ? 8- bi t mpu (80515), 1 clock cycl e per i nstruction with i ntegrated ice for mpu d ebug ? rtc with temperature co mpensation ? auto - c alibration ? hardware watchdog timer, power - fail m onitor ? lcd driver (u p to 152 pi xels) ? up to 18 general - purp ose i/o pi ns ? 32khz time ba se ? 16kb (6521de /dh ) or 32kb (6521fe) f la sh with s ecurity ? 2kb mpu xram ? two uarts for ir and amr ? digital i/o pins com patible with 5v i nputs ? 64- pin lqfp or 68 - p in qfn p ackage ? lead (pb)- free packages mpu rtc timers ia va ib xin xout vref rx/dio1 tx/dio2 v1 tx rx com0..3 v3.3a v3.3 sys vbat v2.5 vbias seg0..18 gnda gndd seg 24..31/ dio 4..11 seg 34..37/ dio 14..17 ice load 88.88.8888 iic or uwire eeprom power fault amr test pulses comparator sense drive/mod serial ports osc/pll converter dio, pulse compute engine flash ram voltage ref regulator power supply teridian 71m6521 3.3v lcd temp sensor 32 khz a neut ct/shunt 07/25/2007 vb b load ir pwr mode control wake-up battery ice_e gndd v3p3d seg 32,33, 38/ice teridian is a trademark and single converter technology is a registered trademark of maxim integrated products inc . micro w ire is a registered trademark of national semiconductor corp .
71m6521de/dh/fe data sheet page: 2 of 107 re v 2 table of contents general description ........................................................................................................................ 1 features ................................................................................................................................................ 1 hardware description ..................................................................................................................... 10 hardware overview ..................................................................................................................... 10 analog front end (afe) ............................................................................................................... 10 input multiplexer ............................................................................................................ 10 a/d converter (adc) ..................................................................................................... 11 fir filter ........................................................................................................................ 11 voltage references ....................................................................................................... 11 temperature sensor ...................................................................................................... 12 battery monitor .............................................................................................................. 13 functional description ................................................................................................... 13 digital computation engine (ce) ................................................................................................. 13 meter equations ............................................................................................................ 14 description ................................................................................................................................... 14 real - time monitor ......................................................................................................... 15 pulse generator ............................................................................................................ 15 ce functional overview ................................................................................................ 15 80515 mpu core ........................................................................................................... 17 memory organization .................................................................................................... 17 special func tion registers (sfrs) ................................................................................ 19 special function registers (generic 80515 sfrs) ....................................................... 20 special function registers specific to the 71m6521de/dh/fe .................................... 22 instruction set ................................................................................................................ 23 uart ............................................................................................................................. 23 timers and counters ..................................................................................................... 25 wd timer (software watchdog timer) .......................................................................... 28 interrupts ....................................................................................................................... 30 on - chip resources ..................................................................................................................... 38 oscillator ....................................................................................................................... 38 pll and internal clocks ................................................................................................ 38 real - time clock (rtc) ................................................................................................. 38 temperature sensor ...................................................................................................... 38 physical memor y ........................................................................................................... 39 optical interface ............................................................................................................ 40 digital i/o ....................................................................................................................... 40 lcd drivers ................................................................................................................... 42 battery monitor .............................................................................................................. 42 eeprom interface ........................................................................................................ 43
71m6521de/dh/fe data sheet re v 2 page: 3 of 107 hardware watchdog timer ............................................................................................ 46 program security ........................................................................................................... 46 test ports ...................................................................................................................... 47 functional description ................................................................................................................... 48 theory of operation ..................................................................................................................... 48 system timing summary ............................................................................................................. 49 battery modes .............................................................................................................................. 50 mission ...................................................................................................................................... 51 brownout mode ....................................................................................................... 51 lcd mode ..................................................................................................................... 52 sleep mode ................................................................................................................. 52 fault and reset behavi or ............................................................................................................ 57 wake up behavior ....................................................................................................................... 57 wake on pb ................................................................................................................... 58 wake on timer .............................................................................................................. 58 data flow ..................................................................................................................................... 59 ce/mpu communication ............................................................................................................. 59 application information ................................................................................................................. 60 connection of sensors (ct, resistive shunt) .............................................................................. 60 distinction between 71m6521de/71m6521fe and 71m6521dh parts ....................................... 60 temperature measurement ......................................................................................................... 61 temperature compensation ........................................................................................................ 61 temperature compensation and mains frequency stabilization for the rtc ............................. 64 connecting 5 v devices ............................................................................................................... 65 connecting lcds ......................................................................................................................... 66 connecting i 2 c eeproms .......................................................................................................... 68 connecting three - wire eeproms ............................................................................................. 69 ua rt0 (tx/rx) ........................................................................................................................... 69 optical interface ........................................................................................................................... 70 connecting v1 and reset pins .................................................................................................... 70 connecting the emulator port pins .............................................................................................. 71 crystal oscillator .......................................................................................................................... 71 flash programming ..................................................................................................................... 72 mpu firmware library ................................................................................................................. 72 meter calibration ......................................................................................................................... 72 firmware interface .......................................................................................................................... 73 i/o ram map ? in numerical order ............................................................................................ 73 sfr map (sfrs specific to the teridian 80515) ? in numerical order ...................................... 74 i/o ram description ? alphabetical order ............................................................................ 75 ce interface description .............................................................................................................. 82 ce progr am ................................................................................................................... 82
71m6521de/dh/fe data sheet page: 4 of 107 re v 2 formats ......................................................................................................................... 82 constants ...................................................................................................................... 82 environment .................................................................................................................. 82 ce calculations ............................................................................................................. 83 ce status .................................................................................................................. 83 ce transfer variables ........................................................................................ 85 electrical specifications .............................................................................................................. 89 absolu te maximum ratings .............................................................................................. 89 recommended external components ......................................................................... 90 recommended operating conditions .......................................................................... 90 performance specifications .......................................................................................... 91 input logic levels ................................................................................................. 91 output logic levels ............................................................................................. 91 power - fault comparator .................................................................................. 91 battery monitor .................................................................................................... 91 supply current ...................................................................................................... 92 v3p3d switch ............................................................................................................ 92 2.5 v voltage regulator ..................................................................................... 92 low power voltage regulator ....................................................................... 92 crystal oscillator .............................................................................................. 93 vref, vbias ................................................................................................................ 93 lcd drivers .............................................................................................................. 94 adc converter, v3p3a referenced ................................................................. 9 4 temperature sensor ........................................................................................... 95 timing specifications ......................................................................................................... 96 ram and flash memory ..................................................................................................................... 96 flash memory timing ............................................................................................ 96 eeprom inter face .................................................................................................. 96 reset and v1 .............................................................................................................. 96 rtc ............................................................................................................................... 96 typical performance data ................................................................................ 97 package outline (lqfp 64) ................................................................................................. 98 packag e outline (qfn 68) ................................................................................................... 98 pinout (lqfp -64) ..................................................................................................................... 100 pinout (qfn 68) ....................................................................................................................... 100 recommended pcb land pattern for the qfn - 68 package ....................................................... 101 pin descriptions ................................................................................................................... 102 power/ground pins: ...................................................................................................... 102 analog pins: .................................................................................................................. 102 digital pins: .................................................................................................................... 103 i/o equivalent cir cuits: .................................................................................................. 104
71m6521de/dh/fe data sheet re v 2 page: 5 of 107 ordering information ...................................................................................................................... 105 revision history ................................................................................................................................. 106
71m6521de/dh/fe data sheet page: 6 of 107 re v 2 list of figures figure 1: ic functional block diagram .................................................................................................................................... 9 figure 2: general topology of a chopped amplifier ............................................................................................................. 11 figure 3: afe block diagram ................................................................................................................................................. 13 figure 4: samples from multiplexer cycle ............................................................................................................................ 16 figure 5: accumulation interval ............................................................................................................................................ 16 figure 6: interrupt structure ................................................................................................................................................. 37 figure 7: optical interface .................................................................................................................................................... 40 figure 8: connecting an external load to dio pins .............................................................................................................. 42 figure 9: 3 - wire interface. write command, hiz=0. ............................................................................................................. 44 figure 10: 3 - wire interface. write command, hiz=1 ............................................................................................................ 44 figure 11: 3 - wire interface. read command. ....................................................................................................................... 45 figure 12: 3 - wire interface. write command when cnt=0 .................................................................................................. 45 figure 13: 3 - wire interface. write command when hiz=1 and wfr=1. .............................................................................. 45 figure 14: functions defined by v1 ...................................................................................................................................... 46 figure 15: voltage. current, momentary and accumulated energy ...................................................................................... 48 figure 16: timing relationship between adc mux, compute engine, and serial transfers. ............................................... 49 figure 17: rtm output format ............................................................................................................................................. 49 figure 18: operation modes state diagram .......................................................................................................................... 52 figure 19: functional blocks in brownout mode (inactive blocks grayed out) ................................................................. 53 figure 20: functional blocks in lcd mode (inactive blocks grayed out) .............................................................................. 54 figure 21: functional blocks in sleep mode (inactive blocks grayed out) .......................................................................... 55 figure 22: transition from brownout to m ission mode when system power returns .................................................. 56 figure 23: power - up timing with v3p3sys and vbat tied together ................................................................................... 56 figure 24: power - up timing with vbat only ....................................................................................................................... 57 figure 25: wake up timing ................................................................................................................................................... 58 figure 26: mpu/ce data flow ............................................................................................................................................... 59 figure 27: mpu/ce communication ..................................................................................................................................... 59 figure 28: resistive voltage divider (left), current transformer (right) ............................................................................ 60 figure 29: resistive shunt .................................................................................................................................................... 60 figure 30: error band for vref over temperature (regular - accuracy parts) ...................................................................... 62 figure 31: error band for vref over temperature (high - accuracy parts) ........................................................................... 63 figure 32: crystal frequency over temperature ................................................................................................................... 64 figure 33: crystal compensation .......................................................................................................................................... 65 figure 34: connecting lcds ................................................................................................................................................. 66 figure 35: i 2 c eeprom connection ...................................................................................................................................... 68 figure 36: three - wire eeprom connection ......................................................................................................................... 69 figure 37: connections for the rx pin .................................................................................................................................. 69 figure 38: connection for optical components .................................................................................................................... 70 figure 39: voltage divider for v1 .......................................................................................................................................... 70 figure 40: external components for reset: development circuit (left), production circuit (right) .................................. 71 figure 41: external components for the emulator interface ................................................................................................. 71 figure 42: wh accuracy, 0.1a to 200a at 240v/50hz and room temperature .................................................................... 97 figure 43: meter accuracy over harmonics at 240v, 30a .................................................................................................... 97 figure 44: typical meter accuracy over temperature relative to 25c (71m6521fe) ......................................................... 98
71m6521de/dh/fe data sheet re v 2 page: 7 of 107 list of tables table 1: inputs selected in regular and alternate multiplexer cycles .................................................................................. 11 table 2: ce dram locations for adc results ...................................................................................................................... 14 table 3: meter equations. .................................................................................................................................................... 14 table 4: memory map ........................................................................................................................................................... 17 table 5: stretch memory cycle width .................................................................................................................................. 18 table 6: internal data memory map ...................................................................................................................................... 19 table 7: special function registers locations ..................................................................................................................... 19 table 8: special function registers reset values ................................................................................................................ 20 table 9: psw register flags ................................................................................................................................................. 21 table 10: psw bit functions ................................................................................................................................................. 21 table 11: port registers ....................................................................................................................................................... 22 table 12: special function registers .................................................................................................................................... 23 table 13: baud rate generation ............................................................................................................................................ 24 table 14: uart modes ......................................................................................................................................................... 24 table 15: the s0con register ............................................................................................................................................. 24 tabl e 16: the s1con register .............................................................................................................................................. 25 table 17: the s0con bit functions ..................................................................................................................................... 25 table 18: the s1con bit functions ..................................................................................................................................... 25 table 19: the tcon register .............................................................................................................................................. 26 table 20: the tcon register bit functions .......................................................................................................................... 26 table 21: the tmod register .............................................................................................................................................. 27 table 22: tmod register bit description ............................................................................................................................ 27 table 23: timers/counters mode description ...................................................................................................................... 27 table 24: timer modes ......................................................................................................................................................... 28 table 25: the pcon register .............................................................................................................................................. 28 table 26: pcon register bit description ............................................................................................................................. 28 table 27: the ien0 register (see also table 32) ................................................................................................................. 29 table 28: the ien0 bit functions (see also table 32) .......................................................................................................... 29 table 29: the ien1 register (see also tables 30/31) .......................................................................................................... 29 table 30: the ien1 bit functions (see also tables 30/31) ................................................................................................... 29 table 31: the ip0 register (see also table 45) .................................................................................................................... 29 table 32: the ip0 bit functions (see also table 45) ............................................................................................................. 30 table 33: the wdtrel register ......................................................................................................................................... 30 table 34: the wdtrel bit functions .................................................................................................................................. 30 table 35: the ien0 register ................................................................................................................................................ 31 table 36: the ien0 bit functions ......................................................................................................................................... 31 table 37: the ien1 register ................................................................................................................................................ 31 tabl e 38: the ien1 bit functions ......................................................................................................................................... 31 table 39: the ien2 register ................................................................................................................................................ 32 table 40: the ien2 bit functions ......................................................................................................................................... 32 table 41: the tcon register .............................................................................................................................................. 32 table 42: the tcon bit functions ....................................................................................................................................... 32 table 43: the t2con bit functions ..................................................................................................................................... 32 table 44: the ircon register ............................................................................................................................................. 33 table 45: the ircon bit functions ..................................................................................................................................... 33 table 46: external mpu interrupts ........................................................................................................................................ 33 table 47: interrupt enable and flag bits .............................................................................................................................. 34 table 48: priority level groups ............................................................................................................................................ 35 table 49: the ip0 register ................................................................................................................................................... 35 table 50: the ip1 register: .................................................................................................................................................. 35 table 51: priority levels ....................................................................................................................................................... 35 table 52: interrupt polling sequence .................................................................................................................................... 36 table 53: interrupt vectors ................................................................................................................................................... 36 table 54: data/direction registers and internal resources for dio pin groups .................................................................. 41
71m6521de/dh/fe data sheet page: 8 of 107 re v 2 table 55: dio_dir control bit ............................................................................................................................................ 41 table 56: selectable controls using the dio_dir bits ........................................................................................................ 42 table 57: eectrl status bits ............................................................................................................................................. 43 table 58: eectrl bits for 3 - wire interface ........................................................................................................................ 44 table 59: tmux [4:0] selections .......................................................................................................................................... 47 table 60: available circuit functions ( means not active) ............................................................................................ 51 table 62: vref definition for the high - accuracy parts ........................................................................................................ 62 table 63: frequency over temperature ................................................................................................................................. 64 table 64: lcd and dio pin assi gnment by lcd_num for the qfn - 68 package ................................................................ 67 table 65: lcd and dio pin assignment by lcd_num for the lqfp - 64 package .............................................................. 68
71m6521de/dh/fe data sheet re v 2 page: 9 of 107 figure 1 : ic functional block diagram ia va mux xin xout vref ckadc cktest/ seg19 ce 32 bit compute engine mpu (80515) ce control opt_rx/ dio1 opt_tx/ dio2/ wpulse/ varpulse reset v1 emulator port ce_busy uart tx rx xfer busy com0..3 vlc2 lcd display driver data 00-7f prog 000-7ff data 0000-ffff prog 0000-7fff 0000- 7fff mpu xram (2kb) 0000-07ff digital i/o config 2000-20ff i/o ram ce ram (0.5kb) memory share 1000-11ff rtclk rtclk (32khz) mux_sync ckce ckmpu ck32 ce_e rtm_e lcd_e lcd_clk lcd_mode dio 4.9 mhz < 4.9mhz 4.9 mhz gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 mpu_div sum_cycles pre_samps equ ckout_e 32khz tmuxout mpu_rstz faultz wake tmux[4:0] configuration parameters gnda vbias december 11, 2006 cross ck_gen osc (32khz) ck32 ckout_e mck pll vref vref_dis div adc mux ctrl mux_div chop_e equ strt ib mux mux ckfir 4.9 mhz rtm seg34/dio14 .. seg37/dio17 wpulse varpulse wpulse varpulse test test mode lcd_mode vlc1 vlc0 lcd_e < 4.9mhz lcd_num dio_r dio_dir lcd_num dio_pv/pw mux_alt seg24/dio4 .. seg31/dio11 sdck sdout sdin e_rxtx/seg38 e_tclk/seg33 e_rst/seg32 flash (16/32kb) flsh66zt v3p3a fir_len fir seg0..18 eeprom interface dio_eex ck_2x eck_dis v3p3d lcd_gen x4mhz pb rtc rtc_inc_sec rtc_dec_sec vb vbias memory share seg32,33 seg19,38 e_rxtx e_tclk e_rst (open drain) ice_e dio1,2 vref_cal ? adc converter + - vref adc_e rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux dio3, dio19/seg39, dio20/seg40, dio21/seg41 (68 pin package only) v3p3d temp vbat vbat vbias optical comp_stat power fault opt_txe opt_txinv opt_rxinv opt_rxdis mod opt_txmod opt_fdc ce_lctn
71m6521de/dh/fe data sheet page: 10 of 107 re v 2 hardware description hardware overview the teridian 71m 6521de/dh/fe single - chip energy meter integrates all primary functional blocks required to implement a solid - state electricity meter. included on chip are an analog front end (afe), an independent digital computation engine (ce), an 8051 - compatible microprocessor (mpu ) which executes one instruction per clock cycle (80515), a voltage reference, a temperature sensor, lcd drivers, ram, f lash memory, a real time clock (rtc), and a variety of i/o pins. various current sensor technologies are supported including current tra nsformers (ct), and resistive shunts. in a typical application, the 32 - bit compute engine (ce) of the 71m 6521de/dh/fe sequentially processes the samples from the voltage inputs on pins ia, va, ib, vb and performs calculations to measure active en ergy (wh), reactive energy (varh), a 2 h, and v 2 h for four - quadrant metering. these measurements are then accessed by the mpu, processed further and output using the peri pheral devices available to the mpu. in addition to advanced measurement functions, th e real time clock function allows the 71m 6521de/dh/fe to record time of use (tou) metering information for multi - rate applications and to time- stamp tamper events. measurements can be displayed on 3.3v lcd commonly used in low tem perature environ ments. flexible mapping of lcd display segments will facilitate integration of existing custom lcd. design trade - off between number of lcd segments vs. dio pins can be implemented in software to accommodate various require ments. in addition to the temper ature - trimmed ultra - precision voltage reference, the on- chip digital temperature com - pensation mechanism includes a temperature sensor and associated controls for correction of unwanted temperature effects on meas ure ment and rtc accuracy, e.g. to meet th e requirements of ansi and iec standards . temperature dependent external com ponents such as crystal oscillator, current transformers (cts), and their corresponding signal conditioning circuits can be character ized and their correction factors can be prog rammed to produce electricity meters with exceptional accuracy over the indus trial temperature range. the 71m6521dh is trimmed at +85c in addition to the trim at room temperature, which provides a set of individualized trim fuse values that enable temp erature compensation with accuracy better than 2 0 ppm/c. one of the two internal uarts is adapted to support an infrared led with internal drive and sense configuration, and can also function as a standard uart. the optical output can be modulated at 38 khz. this flexibility makes it possible to implement amr meters with an ir interface. a block diagram of the ic is shown in figure 1 . a detailed description of variou s functional blocks follows. analog front end (afe) the afe of the 71m 6521de/dh/fe is comp o sed of an input multiplexer, a delta - sigma a/d converter and a voltage reference. input multiplexer the input multiplexer supports up to four input signal s that are applied to pins ia, va, ib and vb of the device. additionally, using the alternate mux selection, it ha s the ability to select temperature and the battery voltage. the multiplexer can be operated in two modes: ? during a normal multiplexer cycle, the signals from the ia, ib, va, and vb pins are selected. ? during the alternate multiplexer cycle, the temperature signal (temp) and the battery monitor are selected, along with the signal sources shown in table 1 . to prevent unnecessary drainage on the battery, the battery monitor is enabled only with the bme bit (0x2020[6]) in the i/o ram. the alternate mux cycles are usually performed infrequently (e.g. every second) by the mpu. in order to prevent disruption of the voltage tracking pll and voltage allpass networks, va is not replaced in the alt mux selections. table 1 details the regular and alternative mux sequences. missing samples due to an alt multiplexer sequence are filled in by the ce.
71m6521de/dh/fe data sheet re v 2 page: 11 of 107 regular mux sequence alt mux sequence mux state mux state equ 0 1 2 3 0 1 2 3 0, 1, 2 ia va ib vb temp va vbat vb table 1 : inputs selected in regular and alternate multiplexer cycles in a typical application, ia and ib are connected to current transformers that sense the current on each phase of the line voltage. va and vb are typically connec ted to voltage sensors through resistor dividers. the multiplexer control circuit handles the setting of the multiplexer. the function of the control circuit is governed by the i/o ram registers mux_alt, mux_div and equ. mux_div controls the number of samp les per cycle. it can request 2, 3, or 4 multiplexer states per cycle. multiplexer states above 4 are reserved and must not be used. the multiplexer always starts at the beginning of its list and proceeds until mux_div states have been converted. the mux_alt bit requests an alternative multiplexer frame. the bit may be asserted on any mpu cycle and may be subsequently de - asserted on any cycle including the next one. a rising edge on mux_alt will cause the multiplexer control circuit to wait until the n ext multiplexer cycle and implement a single alternate cycle. the multiplexer control circuit also controls the fir filter initiation and the chopping of the adc reference voltage, vref. the multiplexer control circuit i s clocked by ck32, the 32768hz cloc k from the pll block, and launches with each new pass of the ce program. a/d converter (adc) a single delta - sigma a/d converter digitizes the voltage and current inputs to the 71m 6521de/dh/fe . the resolution of the adc is programmable using the fir_len register as shown in the i/o ram section. adc resolution can be selected to be 21 bits ( fir_len =0), or 22 bits ( fir_len =1). conversion time is two cycles of ck32 with fir_len = 0 and three cycles with fir_len = 1. in order to provide the maximum re solution, the adc should be operated with fir_len = 1. accuracy and timing specifications in this data sheet are based on fir_len = 1. initiation of each adc conversion is controlled by the multiplexer control circuit as described previously. at the end of each adc conversion, the fir filter output data is stored into the ce dram location determined by the multiplexer selection. fir filter the finite impulse response filter is an integral part of the adc and it is optimized for use with the multiplexer. th e purpose of the fir filter is to decimate the adc output to the desired resolution. at the end of each adc conversion, the output data is stored into the fixed ce dram location determined by the multiplexer selection. fir data is stored lsb justified, but shifted left by nine bits. voltage references the device includes an on - chip precision bandgap voltage reference that incorporates auto- zero techniques. the reference is trimmed to minimize errors caused by component mismatch and drift. the result is a v oltage output with a predictable temperature coefficient. the amplifier within the reference is chopper stabilized, i.e. the polarity can be switched by the mpu using the i/o ram register chop_e (0x2002[5:4]). the two bits in the chop_e register enable the mpu to operate the chopper circuit in regular or inverted operation, or in ?toggling? mode. when the chopper circuit is toggled in between multiplexer cycles, dc offsets on the measured signals will automatically be averaged out. the general topology of a chopped amplifier is given in figure 2 . figure 2 : general topology of a chopped amplifier g - + v inp v outp v outn v inn cross a b a b a b a b
71m6521de/dh/fe data sheet page: 12 of 107 re v 2 it is assumed that an offset voltage voff appears at the positive amplifier input. with all switches, as controlled by cross in the ?a? position, the output voltage is: voutp ? voutn = g (vinp + voff ? vinn) = g (vinp ? vinn) + g voff with all switches set to the ?b? position by applying the inver ted cross signal, the output voltage is: voutn ? voutp = g (vinn ? vinp + voff) = g (vinn ? vinp) + g voff, or voutp ? voutn = g (vinp ? vinn) - g voff thus, when cross is toggled, e.g. after each multiplexer cycle, the offset will alternately appear on t he output as positive and negative, which results in the offset effectively being eliminated, regardless of its polarity or magnitude. when cross is high, the hookup of the amplifier input devices is reversed. this preserves the overall polarity of that a mplifier gain; it inverts its input offset. by alternately reversing the connection, the amplifier?s offset is averaged to zero. this removes the most significant long - term drift mechanism in the voltage reference. the chop_e bits control the behavior o f cross. the cross signal will reverse the amplifier connection in the voltage reference in order to negate the effects of its offset. on the first ck32 rising edge after the last mux state of its sequence, the mux will wait one additional ck32 cycle befo re beginning a new frame. at the beginning of this cycle, the value of cross will be updated according to the chop_e bits. the extra ck32 cycle allows time for the chopped vref to settle. during this cycle, muxsync is held high. the leading edge of mux sync initiates a pass through the ce program sequence. the beginning of the sequence is the serial readout of the 4 rtm words. chop_e has 3 states: positive, reverse, and chop. in the ?positive? state, cross is held low. in the ?reverse? state, cross is held high. in the ?chop? state, cross is toggled near the end of each mux frame, as described above. it is desirable that cross take on alternate values at the beginning of each mux cycle. for this reason, if ?chop? state is selected, cross will not togg le at the end of the last mux cycle in a sum cycle. the internal bias voltage vbias (typically 1. 6 v ) is used by the adc when measuring the temperature and battery monitor signals. temperature sensor the 71m 6521de/dh/fe includes an on - chip tempe rature sensor implemented as a bandgap reference. it is used to determine the die temperature the mpu may request an alternate multiplexer cycle containing the temperature sensor output by asserting mux_alt . the primary use of the temperature data is to de termine the magnitude of compensation required to offset the thermal drift in the system (see section titled ?temperature compensation?).
71m6521de/dh/fe data sheet re v 2 page: 13 of 107 battery monitor the battery voltage is measured by the adc during alternative multiplexer frames if the bme (battery measure enable) bit in the i/o ram is set. while bme is set, an on - chip 45k ? load resistor is applied to the battery, and a scaled fraction of the battery voltage is applied to the adc input. after each alternative mux frame, the result of the adc conversion is available at ce dram address 07. bme is ignored and assumed zero when system power is not available (v1 < vbias). see the battery monitor section of the electrical specifications for details regarding the adc lsb size and the conversion accuracy. functional description the afe functions as a data acquisition system, controll ed by the mpu. the main signals (ia, va, ib, vb) are sampled and the adc counts obtained are stored in ce dram where they can be accessed by the ce and, if necessary, by the mpu. alternate multiplexer cycles are initiated less frequently by the mpu to gath er access to the slow temperature and battery signals. figure 3 : afe block diagram digital computation engine (ce) the ce, a dedicated 32 - bit signal processor, performs the precision computations necessary to accurately measure energy. the ce calculations and processes include: ? multiplication of each current sample with its associated voltage sample to obtain the energy per sample (when multiplied with the constant sample time). ? frequency - insensitive delay cancellation on all six channels (to compensate for the delay bet ween samples caused by the multiplexing scheme). ? 90 phase shifter (for var calculations). ? pulse generation. ? monitoring of the input signal frequency (for frequency and phase information). ? monitoring of the input signal amplitude (for sag detection). ? scaling of the processed samples based on calibration coefficients. the ce program resides in flash memory. common access to flash memory by ce and mpu is controlled by a memory share circuit. each ce instruction word is two bytes long. allocated flash space for the ce program cannot exceed 1024 words (2kb). the ce program counter begins a pass through the ce code each time multiplexer state 0 begins. the code pass ends when a halt instruction is executed. for proper o peration, the code pass must be completed before the multiplexer cycle ends (see system timing summary in the functional description section). the ce program must begin on a 1kbyte boundary of the flash address. the i/o ram register ce_lctn[4:0] defines w hich 1kb boundary contains the ce code. thus, the first ce instruction is located at 1024* ce_lctn[4:0] . the ce dram can be accessed by the fir filter block, the rtm circuit, the ce, and the mpu. assigned time slots are reserved for fir, rtm, and mpu, respe ctively, to prevent bus contention for ce dram data access. holding re - gisters are used to convert 8 - bit wide mpu data to/from 32 - bit wide ce dram data, and wait states are inserted as needed, depending on the frequency of ckmpu. ia va mux vref 4.9 mhz vbias cross ck32 vref vref_dis mux ctrl mux_div chop_e equ ib mux mux_alt v3p3a fir_len fir vb vbias vref_cal ? adc converter + - vref adc_e temp vbat fir_done fir_start
71m6521de/dh/fe data sheet page: 14 of 107 re v 2 the ce dram contains 128 3 2 - bit words. the mpu can read and write the ce dram as the primary means of data commu nication between the two processors. table 2 shows the ce dram addresses allocat ed to analog inputs from the afe. address (hex) name description 00 ia phase a current 01 va phase a voltage 02 ib phase b current 03 vb phase b voltage 04 - not used 05 - not used 06 temp temperature 07 vbat battery voltage table 2 : ce dram locations for adc results the ce of the 71m 6521de/dh/fe is aided by support hardware that facilitates implementation of equations, pulse counters, and accumulators. this support hardware is controlled through i/o ram locations equ (equation assist), dio_pv and dio_pw (pulse count assist), and pre_samps and sum _cycles (accumulation assist). pre_samps and sum_cycles support a dual level accumulation scheme where the first accumulator accumulates results from pre_samps samples and the second accu mulator accumulates up to sum_cycles of the first accumulator result s. the integration time for each energy output is pre_samps * sum_cycles /2520.6 (with mux_div = 1). ce hardware issues the xfer_busy interrupt when the accumula tion is complete. meter equations compute engine (ce) firmware and hardware for residential met er configurations implement the equations listed in table 3 . the register equ (located in the i/o ram) specifies the equation to be used based on the number of phases used for metering. equ description watt & var formula element 0 element 1 0 1 element, 2w 1 with neutral current sense and tamper detection (va connected to vb) va ia va ib 1 1 element, 3w 1 va(ia - ib)/2 n/a 2 2 element, 4w 2 va ia vb ib table 3 : meter equations.
71m6521de/dh/fe data sheet re v 2 page: 15 of 107 real - time monitor the ce contains a real - time monitor (rtm), which can be programmed through the uart to monitor four selectable ce dram locations at full sample rate. the four monitored locations are serially ou tput to the tmuxout pin via the digital output multiplexer at the beginning of each ce code pass. the rtm can be enabled and disabled with rtm_en . the rtm output is clocked by cktest. each rtm word is clocked out in 35 cycles and contains a leading flag bi t. see the functional description section for the rtm output format. rtm is low when not in use. pulse generator the chip contains two pulse generators that create low - jitter pulses at a rate set by either ce or mpu. the function is distinguished by ext_p ulse (a ce input variable in ce dram): ? if ext_pulse = 1, apulsew*wrate and apulser * wrate control the pulse rate (external pulse generation) ? if ext_pulse is 0, apulsew is replaced with wsum_x and apulser is replaced with varsum_x (internal pulse generation). the i/o ram bits dio_pv and dio_pw, as described in the digital i/o section, can be programmed to route wpulse to the output pin dio6 and varpulse to the output pin dio7. pulses can also be output on opt_tx (see opt_txe[1:0] f or details). during each ce code pass, the hardware stores exported sign bits in an 8 - bit fifo and outputs them at a specified interval. this permits the ce code to calculate all of the pulse generator outputs at the beginning of its code pass and to rely on hardware to spread them over the mux frame. the fifo is reset at the beginning of each mux frame. pls_interval controls the delay to the first pulse update and the interval between subsequent updates. its lsb is four ck_fir cycles, or 4 * 203ns. if pls_ interval is zero, the fifo is deactivated and the pulse outputs are updated immediately. thus, n interval is 4* pls_interval. for use with the supplied standard teridian ce code , pls_interval is set to a fixed value of 81. pls_interval is specified so that all of the pulse updates are output before the mux frame completes. on - chip hardware provides a maximum pulse width feature: pls_maxwidth[7:0] selects a maximum negative pulse width to be ?nmax? updates per multiplexer cycle according to the formula: nmax = (2* pls_maxwidth +1). if pls_maxwidth = 255, no width checking is performed. given that pls_interval = 81, the maximum pulse width is determined by: maximum pulse width = (2 * pls_maxwidth +1) * 81*4*203ns = 65.9s + pls_maxwidth * 131.5s if the pulse period corresponding to the pulse rate exceeds the desired pulse width, a square wave with 50% duty - cycle is generated. the ce pulse output polarity is programmable to be either positive or negative. pulse polarity may be inverted with pls_inv . when this bit is set, the pulses are active high, rather than the more usual active low. ce functional overview the adc processes one sample per channel per multiplexer cycle. figure 4 shows the timing of the samples taken during one multiplexer cycle. the number of samples processed during one accumulation cycle is controlled by the i/o ram registers pre_samps (0x2001[7:6]) and sum_cycles (0x2001[5:0]). the integration time for each energy output is pre_samps * sum_cycles / 2520.6, where 2520.6 is the sample rate [hz] for example, pre_samps = 42 and sum_cycles = 50 will establish 2100 samples per accumulation cycle. pre_samps = 100 and sum_cycles = 21 will result in the exact same accumulation cycle of 2100 samples or 833ms. after an accumulation cycle is completed, the xfer_busy interrupt signals to the mpu that accumulated data are available.
71m6521de/dh/fe data sheet page: 16 of 107 re v 2 figure 4 : samples from mul tiplexer cycle the end of each multiplexer cycle is signaled to the mpu by the ce_busy interrupt. at the end of each multiplexer cycle, status information, such as sag data and the digitized input signal, is available to the mpu. figure 5 : accumulation interval figure 5 shows the accumulation interval resulting from pre_samps = 42 and sum_cycles = 50, consisting of 2100 samples of 397s each, followed by the xfer_busy interrupt. the sampling in this example is applied to a 50hz signal. there is no correlation between the line signal frequency and the choice of pre_samps or sum_cycles ( even though when sum_cycles = 42 one set of sum_cycles happe ns to sample a period of 16.6ms). furthermore, sampling does not have to start when the line voltage crosses the zero line, and the length of the accumulation interval need not be an integer multiple of the signal cycles. it is important to note that the l ength of the accumulation interval, as determined by n acc , the product of sum_cycles and pre_samps , is not an exact multiple of 1000ms. for example, if sum_cycles = 60, and pre_samps = 00 (42), the resulting accumulation interval is: ms hz hz f n s acc 75 . 999 62 . 2520 2520 13 32768 42 60 = = ? = = this means that accurate time measurements should be based on the rtc, not the accumulation interval. va ia 1/32768hz = 30.518s 13/32768hz = 397s per mux cycle ib vb xfer_busy interrupt to mpu 20ms 833ms
71m6521de/dh/fe data sheet re v 2 page: 17 of 107 80515 mpu core the 71m 6521de/dh/fe includes an 80515 mpu (8 - bit, 8051 - compatible) that processes most instructions in one clock cycle. using a 5 mhz clock results in a processing throughput of 5 mips. the 80515 architecture eliminates redundant bus states and im plements parallel execution of fetch and execution phases. normally a machine cycle is aligned with a memory fetch, therefore, most of the 1 - byte instructions are performed in a single cycle. this leads to an 8x performance (in average) improvement (in terms of mips) over the intel 8051 device running at the same clock frequency. actual processor clocking speed can be adjusted to the total processing demand of the application (metering calculations, amr management, memory management, lcd driver management and i/o management) using th e i/o ram register mpu_div[2:0] . typical measurement and metering functions based on the results provided by the internal 32 - bit compute engine (ce) are available for the mpu as part of the teridian standard library. a standard ansi ?c? 80515 - applicatio n programming interface library is available to help reduce design cycle. memory organization the 80515 mpu core incorporates the harvard architecture with separate code and data spaces. memory organization in the 80515 is similar to that of the industry s tandard 8051. there are three memory areas: program memory ( f lash), external data memory (xram), physically consisting of xram, ce dram, and i/o ram, and internal data memory (internal ram). table 4 shows the memory map. address (hex) memory technology memory type typical usage wait states (at 5mhz) memory size (bytes) 0000 - 7fff 0000 - 3fff 0000 - 1fff flash memory non - volatile mpu program and non - volatile data 0 32k 16k 8k on 1k boundary flash memory non - volatile ce program 0 2k 0000 - 07ff static ram volatile mpu data xram, 0 2k 1000 - 11ff static ram volatile ce data 6 512 2000 - 20ff static ram volatile configuration ram i/o ram 0 256 table 4 : memory map internal and external data memory: both internal and external data memory are physically located on the 71m 6521de/dh/fe ic. ?ex ternal? data memory is only external to the 80515 mpu core. program memory: the 805 15 can theoretically address up to 64kb of program memory space from 0x0000 to 0xffff. program memory is read when the mpu fetches instructions or performs a movc operation. after reset, the mpu starts program execution from location 0x0000. the lower part of the program memory includes reset and interrupt vectors. the interrupt vectors are spaced at 8 - byte intervals, starting from 0x0003. external data memory: while the 80515 is capable of addressing up to 64kb of external data memory (0x0000 to 0xffff), only the memory ranges shown in table 4 : memory map contain physical memory. the 80515 writes into external data memory when the mpu executes a movx @ri,a or movx @dptr,a instruction. the mpu reads external data memory by executing a movx a,@ri or movx a,@dptr instruction (sfr usr2 provides the upper 8 bytes for the movx a,@ri instruction). clock stretching: movx instructions can access fast or slow external ram and external peripherals. the three low order bits of the ckcon register define the stretch memory cycles. setting all the ckcon stretch bits to one allows access to very slow external ram or external peripherals. table 5 shows how the signals of the external memory interface change when stretch values are set from 0 to 7. the widths of the signals are counted in mpu clock cycles. the post - reset state of the c kcon register, which is in bold in the table, performs the movx instructions with a stretch value equal to 1.
71m6521de/dh/fe data sheet page: 18 of 107 re v 2 ckcon register stretch value read signals width write signal width ckcon.2 ckcon.1 ckcon.0 memaddr memrd memaddr memwr 0 0 0 0 1 1 2 1 0 0 1 1 2 2 3 1 0 1 0 2 3 3 4 2 0 1 1 3 4 4 5 3 1 0 0 4 5 5 6 4 1 0 1 5 6 6 7 5 1 1 0 6 7 7 8 6 1 1 1 7 8 8 9 7 table 5 : stretch memory cycle width there are two types of instructions, differing in whether they provide an eight - bit or sixteen - bit indirect address to the external data ram. in the first type (movx a,@ri), the contents of r0 or r1, in the current register bank, provide the eight lower - ordered bits of address. the eight high - ordered bits of address are specified with the usr2 sfr. this method allows the user paged access (256 pages of 256 bytes each) to all ranges of the external data ram. in the second type of movx instruction (movx a,@dptr), the data pointer generates a sixteen - bit address. this form is faster and more efficient when accessing very large data arrays (up to 64 kbytes), since no additional instructions are needed to set up the eight high ordered bits of address. it is possible to mix the two movx types. this provides the user with four separate data point ers, two with direct access and two with paged access to the entire 64kb of external memory range. dual data pointer: the dual data pointer accelerates the block moves of data. the standard dptr is a 16 - bit register that is used to address external memory or peripherals. in the 80515 core, the standard data pointer is called dptr, the second data pointer is called dptr1 . the data pointer select bit chooses the active pointer. the data pointer select bit is located at the lsb of the dps register ( dps.0 ). dpt r is selected when dps.0 = 0 and dptr1 is selected when dps.0 = 1. the user switches between pointers by toggling the lsb of the dps register. all data pointer - related instructions use the currently selected data pointer for any activity. the second data pointer may not be supported by certain compilers. internal data memory: the internal data memory provides 256 bytes (0x00 to 0xff) of data memory. the internal data memory address is always 1 byte wide and can be accessed by either direct or indirect addr essing. the special function registers occupy the upper 128 bytes . this sfr area is available only by direct addressing. indirect addressing accesses the upper 128 bytes of internal ram.
71m6521de/dh/fe data sheet re v 2 page: 19 of 107 internal data memory: the lower 128 bytes contain working registers and bit - addressable memory. the lower 32 bytes form four banks of eight registers (r0 - r7). two bits on the program memory status word (psw) select which bank is in use. the next 16 bytes form a block of bit - addressable memory space at bit addressees 0x00-0 x7f. all of the bytes in the lower 128 bytes are accessible through direct or indirect addressing. table 6 shows the internal data memory map. address direct addressi ng indirect addressing 0xff special function registers (sfrs) ram 0x80 0x7f byte - addressable area 0x30 0x2f bit - addressable area 0x20 0x1f register banks r0?r7 0x00 table 6 : internal data memory map special function registers (sfrs) a map of the special function registers is shown in table 7 . hex \ bin bit - address- able byte - addressable bin/hex x000 x001 x010 x011 x100 x101 x110 x111 f8 intbits ff f0 b f7 e8 wdi ef e0 a e7 d8 wdcon df d0 psw d7 c8 t2con cf c0 ircon c7 b8 ien1 ip1 s0relh s1relh usr2 bf b0 flshctl pgadr b7 a8 ien0 ip0 s0rell af a0 p2 dir2 dir0 a7 98 s0con s0buf ien2 s1con s1buf s1rell eedata eectrl 9f 90 p1 dir1 dps erase 97 88 tcon tmod tl0 tl1 th0 th1 ckcon 8f 80 p0 sp dpl dph dpl1 dph1 wdtrel pcon 87 table 7 : special function registers location s only a few addresses are occupied, the others are not im plemented. sfrs specific to the 652x are shown in bold print. any read access to unimplemented addresses will return undefined data, while any write access will have no effect. the registers at 0x8 0, 0x88, 0x90, etc., are bit - addressable, all others are byte- addressable.
71m6521de/dh/fe data sheet page: 20 of 107 re v 2 special function registers (generic 80515 sfrs) table 8 shows the location of the sfrs and the value they assume at reset or power - up. name location reset value description p0 0x80 0xff port 0 sp 0x81 0x07 stack pointer dpl 0x82 0x00 data pointer low 0 dph 0x83 0x00 data pointer high 0 dpl1 0x84 0x00 data pointer low 1 dph1 0x85 0x00 data pointer high 1 wdtrel 0x86 0x00 watchdog timer reload register pcon 0x87 0x00 uart speed control tcon 0x88 0x00 timer/counter control tmod 0x89 0x00 timer mode control tl0 0x8a 0x00 timer 0, low byte tl1 0x8b 0x00 timer 1, high byte th0 0x8c 0x00 timer 0, low byte th1 0x8d 0x00 timer 1, high byte ckcon 0x8e 0x01 clock control (stretch=1) p1 0x90 0xff port 1 dps 0x92 0x00 data pointer select register s0con 0x98 0x00 serial port 0, control register s0buf 0x99 0x00 serial port 0, data buffer ien2 0x9a 0x00 interrupt enable register 2 s1con 0x9b 0x00 serial port 1, control register s1buf 0x9c 0x00 serial port 1, data buffer s1rell 0x9d 0x00 serial port 1, reload register, low byte p2 0xa0 0x00 port 2 ien0 0xa8 0x00 interrupt enable register 0 ip0 0xa9 0x00 interrupt priority register 0 s0rell 0xaa 0xd9 serial port 0, reload register, low byte ien1 0xb8 0x00 interrupt enable register 1 ip1 0xb9 0x00 interrupt priority register 1 s0relh 0xba 0x03 serial port 0, reload register, high byte s1relh 0xbb 0x03 serial port 1, reload register, high byte usr2 0xbf 0x00 user 2 port, high address byte for movx@ri ircon 0xc0 0x00 interrupt request control register t2con 0xc8 0x00 polarity for int2 and int3 psw 0xd0 0x00 program status word wdcon 0xd8 0x00 baud rate control register (only wdcon.7 bit used) a 0xe0 0x00 accumulator b 0xf0 0x00 b register table 8 : special function registers reset values
71m6521de/dh/fe data sheet re v 2 page: 21 of 107 accumulator ( acc, a ): acc is the accumulator register. most instructions use the accumulator to hold the operand. the mnemonics for accumulator - specific instructions refer to accumulator as ? a ?, not acc . b register: the b register is used during mul tiply and divide instructions. it can also be used as a scratch - pad register to hold temporary data. program status word ( psw ): msb lsb cv ac f0 rs1 rs ov - p table 9 : psw register flags bit symbol function psw.7 cv carry flag psw.6 ac auxiliary carry flag for bcd operations psw.5 f0 general purpose flag 0 available for user. f0 is not to be confused with the f0 flag in the ce status register. psw.4 rs1 register bank select control bits. the contents of rs1 and rs0 select th e working register bank: rs1/rs0 bank selected location 00 bank 0 (0x00 ? 0x07) 01 bank 1 (0x08 ? 0x0f) 10 bank 2 (0x10 ? 0x17) 11 bank 3 (0x18 ? 0x1f) psw.3 rs0 psw.2 ov overflow flag psw.1 - user defined flag psw.0 p parity flag, affected by hardware to indicate odd / even number of ?one? bits in the accumulator, i.e. even parity. table 10: psw bit functions stack pointer ( sp ): the stack pointer is a 1 - byte register initialized to 0x07 after reset. this register is in cremented before push and call instructions, causing the stack to begin at location 0x08. data pointer: the data pointer ( dptr ) is 2 bytes wide. the lower part is dpl , and the highest is dph . it can be loaded as two registers (e.g. mov dpl,#data8). it is g enerally used to access external code or data space (e.g. movc a,@a+dptr or movx a,@dptr respectively). program counter: the program counter ( pc ) is 2 bytes wide initialized to 0x0000 after reset. this register is incremented when fetching operation code or when operating on data from program memory. port registers: the i/o ports are controlled by special function registers p0 , p1 , and p2 . the c ontents of the sfr can be observed on corresponding pins on the chip. writing a ?1? to any of the ports (see table 11 ) causes the corresponding pin to be at high level (v3p3), and writing a ?0? causes the corresponding pin to be held at low level (gnd). the data direction registers dir0 , dir1 , and dir2 defin e individual pins as input or output pins (see section digital i/o for details).
71m6521de/dh/fe data sheet page: 22 of 107 re v 2 register sfr address r/w description p0 0x80 r/w register for port 0 read and write operations (pins dio4?dio7) dir0 0xa2 r/w data direction register for port 0. setting a bit to 1 means that the corresponding pin is an output. p1 0x90 r/w register for port 1 read and write operations (pins dio8?dio11, dio14 - dio15) dir1 0x91 r/w data direction register for port 1. p2 0xa0 r/w register for port 2 read and write operations (pins dio16?dio17, dio19?dio21) dir2 0xa1 r/w data direction register for port 2. table 11 : port registers all dio ports on the chip are bi - directional. each of them consists of a latch (sfr ? p0 ? to ? p2 ?), an output driver, and an input buffer, therefore the mpu can output or read data through any of these ports. even if a dio pin is configured as an output, the state of the pin can sti ll be read by the mpu, for example when counting pulses issued via dio pins that are under ce control. the technique of reading the status of or generating interrupts based on dio pins configured as outputs, can be used to implement pulse counting. specia l function registers specific to the 71m 6521de/dh/fe table 12 shows the location and description of the 71m 6521de/dh/fe - specific sfrs. register alte rnative name sfr address r/w description erase flsh_erase 0x94 w this register is used to initiate either the flash mass erase cycle or the flash page erase cycle. specific patterns are expected for flsh_erase in order to initiate the appropriate erase cycle (default = 0x00). 0x55 ? initiate flash page erase cycle. must be preceded by a write to flsh_pgadr @ sfr 0xb7. 0xaa ? initiate flash mass erase cycle. must be preceded by a write to flsh_meen @ sfr 0xb2 and the debug port must be enabled. any other pattern written to flsh_erase will have no effect. pgaddr flsh_pgadr 0xb7 r/w flash page erase address register containing the flash memory page address (page 0 thru 127) that will be erased during the page erase cycle (default = 0x00). must be re - written for each new page erase cycle. eedata 0x9e r/w i 2 c eeprom interface data register eectrl 0x9f r/w i 2 c eeprom interface control register. if the mpu wishes to write a byte of data to eeprom, it places the data in eedata and then writes the ?transmit? code to eectrl . the write to eectrl initiates the transmit sequence. see the eeprom interface section for a description of the command and status bits available for eectrl .
71m6521de/dh/fe data sheet re v 2 page: 23 of 107 flshcrl 0xb2 r/w w r/w r bit 0 ( flsh_pwe ): program write enable: 0 ? movx commands refer to xram space, normal operation (default). 1 ? movx @dptr,a moves a to program space (flash) @ dptr. this bit is automatically reset after each byte written to flash. writes to this bit are inhibited when interrupts are enabled. bit 1 ( flsh_meen ): mass erase enable: 0 ? mass erase disabled (default). 1 ? mass erase enabled. must be re - written for each new mass erase cycle. bit 6 ( secure ): enables security provisions that prevent external reading of flash memory and ce program ram. this bit is reset on chip reset and may only be set. attempts to write zero are ignored. bit 7 ( preboot ): indicates that the preboot sequence is active. wdi 0xe8 r/w r/w w only byte operations on the whole wdi register should be used when writing . the byte must have all bits set except the bits that are to be cleared. the multi - purpose register wdi contains the following bits: bit 0 ( ie_xfer ): xfer interrupt flag: this flag mo nitors the xfer_busy interrupt. it is set by hardware and must be cle ared by the in terrupt handler bit 1 ( ie_rtc ): rtc interrupt flag: this flag mo nitors the rtc_1sec inter rupt. it is set by hardware and must be cleared by the in terrupt handler bit 7 ( wd_rst ): wd timer reset: read: reads the pll_fall interrupt flag writ e 0: clears the pll_fall interrupt flag write 1: resets the watch dog timer intbits int0?int6 0xf8 r interrupt inputs. the mpu may read these bits to see the input to external interrupts int0, int1, up to int6. these bits do not have any memory and are primarily intended for debug use table 12 : special function registers instruction set all instructions of the generic 8051 microcontroller are supported. a complete list of the instruction set and of the associated op - codes is contained in the 71m6521 software user?s guide (sug). uart the 71m 6521de/dh/fe includes a uart (uart0) that can be programmed to communicate with a variety of amr modules. a second uart (uart1) is connected to the optical port, as described in the optical port description. the uarts are dedicated 2 - wire serial interfaces, which can communicate with an external host processor at up to 38,400 bits/s (with mpu clock = 1.2288mhz). the operation of each pin is as follows: rx : serial input data are applied at this pin. conforming to rs - 232 standard, the bytes are input lsb first. tx : this pin is used to output the serial data. the bytes are output lsb first. the 71m 6521de/dh/fe has several uart - related registers for the control and buffering of serial data. all uart transfers are pro grammable for parity enable, parity, 2 stop bits/1 stop bit and xon/xoff options for variable communication baud rates from 300 to 38400 bps. table 13 shows how the baud rates are calculated. table 14 shows the selectable uart operation modes.
71m6521de/dh/fe data sheet page: 24 of 107 re v 2 using timer 1 using internal baud rate g enerator uart 0 2 smod * f ckmpu / (384 * (256 - th1)) 2 smod * f ckmpu /(64 * (2 10 - s0rel)) uart 1 n/a f ckmpu /(32 * (2 10 - s1rel)) note: s0rel and s1rel are 10 - bit values derived by combining bits from the respective timer reload registers. smod is the smod bit in the sfr pcon . th1 is the high byte of timer 1. table 13 : baud rate generation uart 0 uart 1 mode 0 n/a start bit, 8 data bits, parity, stop bit, variable baud rate (internal baud rate generator) mode 1 start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator or timer 1) start bit, 8 data bits, stop bit, variable baud rate (internal baud rate generator) mode 2 start bit, 8 data bits, parity, stop bit, fixed baud rate 1/32 or 1/64 of f ckmpu n/a m ode 3 start bit, 8 data bits, parity, stop bit, variable baud rate (internal baud rate generator or timer 1) n/a table 14 : uart modes parity of serial data is available through the p flag of the accumulator. seven - bit serial modes with parity, such as those used by the flag protocol, can be simulated by setting and reading bit 7 of 8 - bit output data. seven - bit serial modes without parity can be simulated by setting bit 7 to a constant 1. 8 - bit serial modes with parity can be simula ted by setting and reading the 9 th bit, using the control bits tb80 ( s0con .3) and tb81 ( s1con .3) in the s0con and s1con sfrs for transmit and rb81 ( s1con .2) for receive operations. sm20 ( s0con .5) and sm21 ( s1con .5) can be used as handshake signals for inter- processor communication in multi - processor systems. serial interface 0 control register ( s0con ). the function of the uart0 depends on the setting of the serial port control register s0con . msb lsb sm0 sm1 sm20 ren0 tb80 rb80 ti0 ri0 table 15 : the s0con register serial interface 1 control register ( s1con ). the function of the serial port depends on the setting of the serial port control register s1con .
71m6521de/dh/fe data sheet re v 2 page: 25 of 107 msb lsb sm - sm21 ren1 tb81 rb81 ti1 ri1 table 16 : the s1con register bit symbol function s0con.7 sm0 these two bits set the uart0 mode: mode description sm0 sm1 0 n/a 0 0 1 8 - bit uart 0 1 2 9 - bit uart 1 0 3 9 - bit uart 1 1 s0con.6 sm1 s0con.5 sm20 enables the inter - processor communication feature. s0con.4 ren0 if set, enables serial reception. cleared by software to disable reception. s0con .3 tb80 the 9 th transmitted data bit in modes 2 and 3. set or cleared by the mpu, depending on the function it performs (parity check, multiprocessor communication etc.) s0con.2 rb80 in modes 2 and 3 it is the 9 th data bit received. in mode 1, if sm20 is 0, rb80 is the stop bit. in mode 0 this bit is not used. must be cleared by software s0con.1 ti0 transmit interrupt flag, set by hardware after completion of a serial transfer. must be cleared by software. s0con.0 ri0 receive interrupt flag, set by hardware after completion of a serial reception. must be cleared by software table 17 : the s0con bit functions bit symbol function s1con.7 sm sets the baud rate for uart1 sm mode description baud rate 0 a 9 - bit uart variable 1 b 8 - bit uart variable s1con.5 sm21 enables the inter - processor communication feature. s1con.4 ren1 if set, enables serial reception. cleared by software to disable reception. s1con .3 tb81 the 9 th transmitted data bit in mode a. set or cleared by the mpu, depending on the function it performs (parity check, multiprocessor communication etc.) s1con.2 rb81 in modes a and b, it is the 9 th data bit received. in mode b, if sm21 is 0, rb81 is the stop b it. must be cleared by software s1con.1 ti1 transmit interrupt flag, set by hardware after completion of a serial transfer. must be cleared by software. s1con.0 ri1 receive interrupt flag, set by hardware after completion of a serial reception. must be cleared by software table 18 : the s1con bit functions timers and counters the 80515 has two 16 - bit timer/counter registers: timer 0 and timer 1. these registers can be configured for counter or timer operations. in timer mode, the register is incremented every machine cycle meaning that it counts up after every 12 periods of the mpu clock signal.
71m6521de/dh/fe data sheet page: 26 of 107 re v 2 in counter mode, the register is incremented when the falling edge is observed at the corresponding input signal t0 or t1 (t0 and t1 are the timer gating inputs derived from certain dio pins, see the dio ports chapter). since it takes 2 machine cycles to recognize a 1 -to - 0 event, the maximum input count rate is 1/2 of the oscillator frequency. there are no restrictions on the duty cycle, ho wever to ensure proper recognition of 0 or 1 state, an input should be stable for at least 1 machine cycle. the timers/counters are controlled by the tcon register timer/counter control register ( tcon ) msb lsb tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 table 19 : the tcon register bit symbol function tcon.7 tf1 the timer 1 overflow flag is set by hardware when timer 1 overflows. this flag can be cleared by software and is automatically cleared when an interrupt is processed. tcon.6 tr1 timer 1 run control bit. if cleared, timer 1 stops. tcon.5 tf0 timer 0 overflow flag set by hardware when timer 0 overflows. this flag can be cleared by software and is automatically cleared when an interrupt is processed. tcon.4 tr0 timer 0 run control bit. if cleared, timer 0 stops. tcon.3 ie1 interrupt 1 edge flag is set by hardware when the falling edge on external pin int1 is observed. cleared when an interrupt is processed. tcon.2 it1 interrupt 1 type control bit. selects either the falling edge o r low level on input pin to cause an interrupt. tcon.1 ie0 interrupt 0 edge flag is set by hardware when the falling edge on external pin int0 is observed. cleared when an interrupt is processed. tcon.0 it0 interrupt 0 type control bit. selects either the falling edge or low level on input pin to cause interrupt. table 20 : the tcon register bit functions
71m6521de/dh/fe data sheet re v 2 page: 27 of 107 four operating modes can be selected for timer 0 and timer 1. two special function registers ( tmod and tcon ) are used to select the appropriate mode. timer/counter mode control register ( tmod ): msb lsb gate c/t m1 m0 gate c/t m1 m0 timer 1 timer 0 table 21 : the tmod register bits tr1 ( tcon.6 ) and tr0 (tcon.4) in the tcon register (see table 19 and table 20 ) start their associated timers when set. bit symbol function tmod.7 tmod.3 gate if set, enables external gate control (pin int0 or int1 for counter 0 or 1, respectively). when int0 or int1 is high, and trx bit is set (see tcon register), a counter is incremented every falling edge on t0 or t1 input pin tmod.6 tmod.2 c/t selects timer or counter operation. when set to 1, a counter operation is performed. when cleared to 0, the corresponding register will function as a timer. tmod.5 tmod.1 m1 selects the mode for timer/counter 0 or timer/counter 1, as shown in tmod description. tmod.4 tmod.0 m0 selects the mode for timer/counter 0 or timer/counter 1, as shown in tmod description. table 22: tmod register bit description m1 m0 mode function 0 0 mode 0 13- bit counter/timer with 5 lower bits in the tl0 or tl1 register and the remaining 8 bits in the th0 or th1 register (for timer 0 and timer 1, respectively). the 3 high order bits of tl0 and tl1 are held at zero. 0 1 mode 1 16- bit counter/timer. 1 0 mode 2 8 - bit auto- reload counter/timer. the reload value is kept in th0 or th1 , while tl0 or tl1 is incremented every machine cycle. when tl (x) overflows, a value from th (x) is copied to tl (x). 1 1 mode 3 if timer 1 m1 and m0 bits are set to '1', timer 1 stops. if timer 0 m1 and m0 bits are set to '1', timer 0 acts as two independent 8 - bit timer/counters. table 23 : timers/counters mode description note: in mode 3, tl0 is affected by tr0 and gate control bits, and sets the tf0 flag on overflow, while th0 is affected by the tr1 bit, and the tf1 flag is set on overflow.
71m6521de/dh/fe data sheet page: 28 of 107 re v 2 table 24 specifies the combinations of operation modes allowed for timer 0 and timer 1: timer 1 mode 0 mode 1 mode 2 timer 0 - mode 0 yes yes yes timer 0 - mode 1 yes yes yes timer 0 - mode 2 not allowed not allowed yes table 24 : timer modes timer/counter mode control register ( pcon ): msb lsb smod -- -- -- -- -- -- -- table 25 : the pcon register the smod bit in the pcon register doubles the baud rate when set. bit symbol function pcon.7 smod baud rate control. table 26: pcon register bit description wd timer (software watchdog timer) the software watchdog timer is a 16 - bit counter that is incremented once every 24 or 384 clock cycles. after a reset, the watchdog timer is disabled and all registers are set to zero. the watchdog consists of a 16 - bit counter (wdt), a reload register ( wdtr el ), prescalers (by 2 and by 16), and control logic. once the watchdog is started, it cannot be stopped unless the internal reset signal becomes active. note: it is recommended to use the hardware watchdog timer instead of the software watchdog timer. w d timer start procedure: the wdt is started by setting the swdt flag. when the wdt register enters the state 0x7cff, an asynchronous wdts signal will become active. the signal wdts sets bit 6 in the ip0 register and requests a reset state. wdts is cleared either by the reset signal or by changing the state of the wdt timer. refreshing the wd timer: the watchdog timer must be refreshed regularly to prevent the reset request signal from becoming active. this requirement imposes an obligation on the programmer to issue two instructions. the first instruction sets wdt and the second instruction sets swdt. the maximum delay allowed between setting wdt and swdt is 12 clock cycles. if this period has expired and swdt has not been set, the wdt is automatically reset , otherwise the watchdog timer is reloaded with the content of the wdtrel register and the wdt is automatically reset. since the wdt requires exact timing, firmware needs to be designed with special care in order to avoid unwanted wdt resets. it i s strongly discourage d to use the software wdt.
71m6521de/dh/fe data sheet re v 2 page: 29 of 107 special function registers for the wd timer interrupt enable 0 register ( ien0 ): msb lsb eal wdt et2 es0 et1 ex1 et0 ex0 table 27 : the ien0 register (see also table 32) bit symbol function ien0.6 wdt watchdog timer refresh flag. set to initiate a refresh of the watchdog timer. must be set directly before swdt is set to prevent an unintentional refresh of the watchdog timer. wdt is reset by hardware 12 clock cycles after it has been set. table 28 : the ien0 bit functions (see also table 32) note: the remaining bits in the ien0 register are not used for watchdog control interrupt enable 1 register ( ien1 ): msb lsb exen2 swdt ex6 ex5 ex4 ex3 ex2 table 29 : the ien1 register (see also tables 30/31) bit symbol function ien1.6 swdt watchdog timer start/refresh flag. set to activate/refresh the watchdog timer. when directly set after setting wdt , a watchdog timer refresh is performed. bit swdt is reset by the hardware 12 clock cycles after it has been set. table 30 : the ien1 bit functions (see also tables 30/31) note: the remaining bits in the ien1 register are not used for watchdog control interrupt priority 0 register ( ip0 ): msb lsb -- wdts ip0.5 ip0.4 ip0.3 ip0.2 ip0.1 ip0.0 table 31 : the ip0 register (see also table 45)
71m6521de/dh/fe data sheet page: 30 of 107 re v 2 bit symbol function ip0.6 wdts watchdog timer status flag. set when the watchdog timer was started. can be read by software. table 32 : the ip0 bit functions (see also table 45) note: the remaining bits in the ip0 register are not used for watchdog control watchdog timer reload register ( wdtrel ): msb lsb 7 6 5 4 3 2 1 0 table 33 : the wdtrel register bit symbol function wdtrel.7 7 prescaler select bit. when set, the watchdog is clocked through an additional divide -by - 16 prescaler wdtrel.6 to wdtrel.0 6 -0 seven bit reload value for the high - byte of the watchdog timer. this value is loaded to the wdt when a refresh is triggered by a consecutive setting of bits wdt and swdt . table 34 : the wdtrel bit functions the wdtrel register can be loaded and read at any time. interrupts the 80515 provides 11 interrupt sources with four priority levels. each source has its own request flag(s) located in a special function register ( tcon, ircon , and scon ). each interrupt requested by the corresponding flag can be individually enabled or disabled by the enable bits in sfrs ien0 , ien1 , and ien2 . external interrupts are the interrupts external to the 80515 core, i.e. signals that originate in other parts of the 71m 6521de/dh/fe , for example the ce, dio, rtc eeprom interface. interrupt overview when an interrupt occurs, the mpu will vector to the predetermined address as shown in table 53 . on ce interrupt service has begun, it can be interrupted only by a higher priority interrupt. the interrupt service is terminated by a return from instruction, "reti". when an reti is performed, the mpu will return to the instruction that would have been next when the interrupt occurred. when the interrupt condition occurs, the mpu will also indicate this by setting a flag bit. this bit is set regardless of whether the interrupt is enabled or disabled. each interrupt flag is sampled once per machine cycle, the n samples are polled by the hardware. if the sample indicates a pending interrupt when the interrupt is enabled, then the interrupt request flag is set.
71m6521de/dh/fe data sheet re v 2 page: 31 of 107 on the next instruction cycle, the interrupt will be acknowledged by hardware forcing an lcall to the appropriate vector address, if the following conditions are met: ? no interrupt of equal or higher priority is already in progress. ? an instruction is currently being executed and is not completed. ? the instruction in progress is not reti or any write access t o the registers ien0, ien1, ien2, ip0 or ip1 . special function registers for interrupts: interrupt enable 0 register ( ie0 ) msb lsb eal wdt es0 et1 ex1 et0 ex0 table 35 : the ien0 register bit symbol function ien0.7 eal eal =0 ? disable all interrupts ien0.6 wdt not used for interrupt control ien0.5 - ien0.4 es0 es0 =0 ? disable serial channel 0 interrupt ien0.3 et1 et1 =0 ? disable timer 1 overflow interrupt ien0.2 ex1 ex1 =0 ? disable external interrupt 1 ien0.1 et0 et0 =0 ? disable timer 0 overflow interrupt ien0.0 ex0 ex0 =0 ? disable external interrupt 0 table 36 : the ien0 bit functions interrupt enable 1 register ( ien1 ) msb lsb swdt ex6 ex5 ex4 ex3 ex2 table 37 : the ien1 register bit symbol function ien1.7 - ien1.6 swdt not used for interrupt control ien1.5 ex6 ex6 =0 ? disable external interrupt 6 ien1.4 ex5 ex5 =0 ? disable external interrupt 5 ien1.3 ex4 ex4 =0 ? disable external interrupt 4 ien1.2 ex3 ex3 =0 ? disable external interrupt 3 ien1.1 ex2 ex2 =0 ? disable external interrupt 2 ien1.0 - table 38 : the ien1 bit functions
71m6521de/dh/fe data sheet page: 32 of 107 re v 2 interrupt enable 2 register ( ie2 ) msb lsb - - - - - - - es1 table 39 : the ien2 register bit symbol function ien2.0 es1 es1 =0 ? disable serial channel 1 interrupt table 40 : the ien2 bit functions timer/counter control register ( tcon ) msb lsb tf1 tr1 tf0 tr0 ie1 it1 ie0 it0 table 41 : the tcon register bit symbol function tcon.7 tf1 timer 1 overflow flag tcon.6 tr1 not used for interrupt control tcon.5 tf0 timer 0 overflow flag tcon.4 tr0 not used for interrupt control tcon.3 ie1 external interrupt 1 flag tcon.2 it1 external interrupt 1 type control bit tcon.1 ie0 external interrupt 0 flag tcon.0 it0 external interrupt 0 type control bit table 42 : the tcon bit functions timer2/counter2 control register ( t2con ): bit symbol function t2con.7 -- not used t2con.6 i3fr polarity control for int3: 0 - falling edge, 1 ? rising edge t2con.5 i2fr polarity control for int3: 0 - falling edge, 1 ? rising edge tcon.4 ? t2con0 -- not used table 43 : the t2con bit functions
71m6521de/dh/fe data sheet re v 2 page: 33 of 107 interrupt request register ( ircon ) msb lsb ex6 iex5 iex4 iex3 iex2 table 44 : the ircon register bit symbol function ircon.7 - ircon.6 - ircon.5 iex6 external interrupt 6 edge flag ircon.4 iex5 external interrupt 5 edge flag ircon.3 iex4 external interrupt 4 edge flag ircon.2 iex3 external interrupt 3 edge flag ircon.1 iex2 external interrupt 2 edge flag ircon.0 - table 45 : the ircon bit functions only tf0 and tf1 (timer 0 and timer 1 overflow flag) will be automatically cleared by hardware when the service routine is called (signals t0ack and t1ack ? port isr ? active high when the service routine is called). external interrupts the 71m 6521de/dh/fe mpu a llows seven external interrupts. these are connected as shown in table 46 . the direction of interrupts 2 and 3 is programmable in the mpu. interrupts 2 and 3 should be programmed for falling sensitivity. the generic 8051 mpu literature states that interrupt 4 through 6 are defined as rising edge sensitive. thus, the hardware si gnals attached to interrupts 5 and 6 are inverted to achieve the edge polarity shown in table 46. external interrupt connection polarity flag reset 0 digital i/o high priority see dio_rx automatic 1 digital i/o low priority see dio_rx automatic 2 fwcol0, fwcol1 falling automatic 3 ce_busy falling automatic 4 pll_ok (rising), pll_ok (falling) rising automatic 5 eeprom busy falling automatic 6 xfer_busy or rtc_1sec falling manual table 46 : external mpu interrupts fwcolx interrupts occur when the ce collides with a flash write attempt. see the flash write description for more detail. sfr (special function register) enable bits must be set to permit any of these interrupts to occur. likewise, each interrupt has its own flag bit, which is set by the interrupt hardware, and reset by the mpu interrupt handler. note that xfer_busy, rtc_1sec, fwcol0, fwcol1, pllrise, pllfall, have their own enable and flag bits in addition to the interrupt 6, 4, and 2 enable and flag bits. ie0 through iex6 are cleared automatical ly when the hardware vectors to the interrupt handler. the other flags, ie_xfer through ie_pb , are cleared by writing a zero to them. since these bits are in a bit - addressable sfr byte, common practice would be to clear them with a bit operation. this is t o be avoided. the hardware implements bit operations as a byte wide read - modify - write hardware macro. if an interrupt occurs after the read, but before the write, its flag will be cleared un intentionally. the proper way to clear the flag bits is to write a byte mask consisting of all ones except for a zero in the location of the bit to be cleared. the flag bits are configured in hardware to ignore ones written to them.
71m6521de/dh/fe data sheet page: 34 of 107 re v 2 interrupt enable interrupt flag interrupt description name location name location ex0 sfr a8[[0] ie0 sfr 88[1] external interrupt 0 ex1 sfr a8[2] ie1 sfr 88[3] external interrupt 1 ex2 sfr b8[1] iex2 sfr c0[1] external interrupt 2 ex3 sfr b8[2] iex3 sfr c0[2] external interrupt 3 ex4 sfr b8[3] iex4 sfr c0[3] external interrupt 4 ex5 sfr b8[4] iex5 sfr c0[4] external interrupt 5 ex6 sfr b8[5] iex6 sfr c0[5] external interrupt 6 ex_xfer 2002[0] ie_xfer sfr e8[0] xfer_busy interrupt (int 6) ex_rtc 2002[1] ie_rtc sfr e8[1] rtc_1sec interrupt (int 6) ex_fwcol 2007[4] ie_fwcol0 sfr e8[3] fwcol0 interrupt (int 2) ie_fwcol1 sfr e8[2] fwcol1 interrupt (int 2) ex_pll 2007[5] ie_pllrise sfre8[6] pll_ok rise interrupt (int 4) ie_pllfall sfre8[7] pll_ok fall interrupt (int 4) ie_wake sfre8[5] autowake flag ie_pb sfre8[4] pb flag table 47 : interrupt enable and flag bits the autowake and pb flag bits are shown in table 47 because they behave similarly to interrupt flags, even though they are not actually related to an interrupt. these bits are set by hardware when the mpu wakes from a push button or wake timeo ut. the bits are reset by writing a zero. note that the pb flag is set whenever the pb is pushed, even if the part is already awake. each interrupt has its own flag bit, which is set by the interrupt hardware and is reset automatically by the mpu interrupt handler (0 through 5). xfer_busy and rtc_1sec, which are or - ed together, have their own enable and flag bits in addition to the interrupt 6 enable and flag bits (see table 47 ), and these interrupts must be cleared by the mpu software. when servicing the xfer_busy and rtc_1sec interrupts, special care must be taken to avoid lock - up conditions: if, for example, the xfer_busy interrupt is serviced, control must not retu rn to the main program without checking the rtc_1sec flag. if this rule is ignored, a rtc_1sec interrupt appearing during the xfer_busy service routine will disable the processing of any xfer_busy or rtc_1sec interrupt, since both interrupts are edge - trigg ered (see the software user?s guide sug652x). the external interrupts are connected as shown in table 47 . the po larity of interrupts 2 and 3 is programmable in the m pu via the i3fr and i2fr bits in t2con . interrupts 2 and 3 should be programmed for falling sensitivity. the generic 8051 mpu literature states that interrupts 4 through 6 are defined as rising edge sensitive. thus, the hardware signals attached to interru pts 5 and 6 are inverted to achieve the edge polarity shown in table 47. sfr (special function register) enable bits must be set to permit any of these interrupts to o ccur. likewise, each interrupt has its own flag bit that is set by the interrupt hardware and is reset automatically by the mpu interrupt handler (0 through 5). xfer_busy and rtc_1sec , which are or - ed together, have their own enable and flag bits in addition to the interrupt 6 enable and flag bits (see table 47 ), and these interrupts must be cleared by the mpu software.
71m6521de/dh/fe data sheet re v 2 page: 35 of 107 interrupt priority level structure all int errupt sources are combined in groups, as shown in table 48: group 0 external interrupt 0 serial channel 1 interrupt 1 timer 0 interrupt - external interrupt 2 2 external interrupt 1 - external interrupt 3 3 timer 1 interrupt - external interrupt 4 4 serial channel 0 interrupt - external interrupt 5 5 - - external interrupt 6 table 48 : priority level groups each group of interrupt sources can be programmed individually to one of four priority levels by setting or clearing one bit in the special function register ip0 and one in ip1 . if requests of the same priority level are received simultaneously, an internal polling sequence as pe r table 52 determines which request is serviced first. an overview of the interrupt structure is given in figure 6 . ien enable bits must be set to permit any of these interrupts to occur. likewise, each interrupt has its own flag bit that is set by the interrupt hardware and is reset automatically by the mpu interrupt handler (0 through 5). xfer_busy and rtc_1sec, which are or - ed together, have their own enable and flag bits in addition to the interrupt 6 enable and flag bits (see table 47 ) and these interrupts must be cleared by th e mpu software. interrupt priority 0 register ( ip0 ) msb lsb -- wdts ip0.5 ip0.4 ip0.3 ip0.2 ip0.1 ip0.0 table 49 : the ip0 register note: wdts is not used for interrupt controls interrupt priority 1 register ( ip1 ) msb lsb - - ip1.5 ip1.4 ip1.3 ip1.2 ip1.1 ip1.0 table 50 : the ip1 register: ip1.x ip0.x priority level 0 0 level0 (lowest) 0 1 level1 1 0 level2 1 1 level3 (highest) table 51 : priority levels
71m6521de/dh/fe data sheet page: 36 of 107 re v 2 external interrupt 0 polling sequence serial channel 1 interrupt timer 0 interrupt external interrupt 2 external interrupt 1 external interrupt 3 timer 1 interrupt external interrupt 4 serial channel 0 interrupt external interrupt 5 external interrupt 6 table 52 : interrupt polling sequence interrupt sources and vectors table 53 shows the interrupts with their associated flags and vector address es. interrupt request flag description interrupt vector address ie0 external interrupt 0 0x0003 tf0 timer 0 interrupt 0x000b ie1 external interrupt 1 0x0013 tf1 timer 1 interrupt 0x001b ri0/ti0 serial channel 0 interrupt 0x0023 ri1/ti1 serial channel 1 interrupt 0x0083 iex2 external interrupt 2 0x004b iex3 external interrupt 3 0x0053 iex4 external interrupt 4 0x005b iex5 external interrupt 5 0x0063 iex6 external interrupt 6 0x006b table 53 : interrupt vectors
71m6521de/dh/fe data sheet re v 2 page: 37 of 107 figure 6 : interrupt structure ie0 individual interrupt flags ri1 ti1 general interrupt flags internal/ external source >=1 tf0 int2 ie1 int3 tf1 int4 ri0 ti0 >=1 int5 int6 ircon.1 i2fr ircon.2 i3fr ircon.3 ircon.4 ircon.5 ien0.7 ip1.0/ ip0.0 ip1.1/ ip0.1 ip1.2/ ip0.2 ip1.3/ ip0.3 ip1.4/ ip0.4 ip1.5/ ip0.5 interrupt control register priority assignment interrupt vector polling sequence interrupt enable logic and polarity selection dio uart1 (optical) timer 0 dio timer 1 ce_busy uart0 eeprom/ i2c xfer_busy rtc_1s ien0.0 ien2.0 ien0.1 ien1.1 ien0.2 ien1.2 ien0.3 ien1.3 ien0.4 ien1.4 ien1.5 ie_xfer ie_rtc flash write collision ie_fwcol0 ie_fwcol1 pll ok ie_pllrise ie_pllfall
71m6521de/dh/fe data sheet page: 38 of 107 re v 2 on - chip resources oscillator the 71m 6521de/dh/fe oscillator drives a standard 32.768khz watch crystal. these crystals are accurate and do not require a high - current oscillator circuit. the 71m 6521de/dh/fe oscillator has been designed specifically to handle these crystals and is compatible with their high impedance and limited power handling capability. pll and internal clocks timing for the device is derived from the 32.768khz oscillator output. on - chip timing functions include the mpu master clock, a real time clock (rtc), and the delta - sigma sample clock. in addition, the mpu has two general counter/timers (see mpu section). the adc master clock, ckadc, is generated by an on - chip pll. it multiplies the oscillator output frequency ( ck32) by 150. the ce clock frequency is always ck32 * 150, or 4.9152mhz, where ck32 is the 32khz clock. the mpu clock frequency is determined by mpu_div and can be 4.9152mhz *2 - mpu_div hz where mpu_div varies from 0 to 7 ( mpu_div is 0 on power - up). this makes the mpu clock scalable from 4.9152mhz down to 38.4khz. the circuit also generates a 2x mpu clock for use by the emulator. this clock is not generated when eck_dis is asserted by the mpu. the setting of mpu_div is maintained w hen the device transitions to brownout mode, but the time base in brownout mode is 28,672hz. real - time clock (rtc) the rtc is driven directly by the crystal oscillator. it is powered by the net v2p5nv (battery - backed up supply). the rtc consists of a count er chain and output registers. the counter chain consists of seconds, minutes, hours, day of week, day of month, month, and year. the rtc is capable of processing leap years. each counter has its own output register. whenever the mpu reads the seconds regi ster, all other output registers are automatically updated. since the rtc clock is not coherent to the mpu clock, the mpu must read the seconds register until two consecutive reads are the same (requires either 2 or 3 reads). at this point, all rtc output registers will have the correct time. regardless of the mpu clock speed, rtc reads require one wait state. rtc time is set by writing to the rtc registers in i/o ram. each byte written to rtc must be delayed at least 3 rtc cycles from any previous byte wr itten to rtc. hardware rtc write protection requires that a write to address 0x201f occur before each rtc write. writing to address 0x201f opens a hardware ?enable gate? that remains open until an rtc write occurs and then closes. it is not necessary to di sable interrupts between the write operation to 0x201f and the rtc write because the ?enable gate? will remain open until the rtc write finally occurs two time correction bits, rtc_dec_sec and rtc_inc_sec are provided to adjust the rtc time. a pulse on one of these bits causes the time to be decremented or incremented by an additional second at the next update of the rtc_sec register. thus, if the crystal temperature coefficient is known, the mpu firmware can integrate temperature and correct the rtc time a s necessary. temperature sensor the device includes an on - chip temperature sensor for determining the temperature of the bandgap reference. the mpu may request an alternate multiplexer frame containing the temperature sensor output by asserting mux_alt . th e primary use of the temperature data is to determine the magnitude of compensation required to offset the thermal drift in the system (see section titled ?temperature compensation?).
71m6521de/dh/fe data sheet re v 2 page: 39 of 107 physical memory flash memory: the 71m 6521de/dh/fe includes 16k b (71m6521de /dh ) or 32kb (71m6521fe) of on - chip flash memory. the flash memory primarily contains mpu and ce program code. it also contains images of the ce dram, mpu ram, and i/o ram. on power - up, before enabling the ce, the mpu copies these images to th eir respective locations. allocated flash space for the ce program cannot exceed 1024 words (2kb). the ce program must begin on a 1kb boundary of the flash address. the ce_lctn[4:0] word defines which 1kb boundary contains the ce code. thus, the first ce instruction is located at 1024* ce_lctn[4:0] . ce_lctn must be defined before the ce is enabled. the flash memory is segmented into 512 byte individually erasable pages. the ce engine cannot access its program memory when flash write occurs. thus, the flash write procedure is to begin a sequence of flash writes when ce_busy falls (ce_busy interrupt) and to make sure there is sufficient time to complete the sequence before ce_busy rises again. the actual time for the flash write operation will depend on the e xact number of cycles required by the ce program. typically (ce program is 512 instructions, mux frame is 13 ck32 cycles), there will be 200s of flash write time, enough for 4 bytes of flash write. if the ce code is shorter, there will be even more time. two interrupts warn of collisions between the mpu firmware and the ce timing. if a flash write is attempted while the ce is busy, the flash write will not execute and the fw_col0 interrupt will be issued. if a flash write is still in progress when the ce would otherwise begin a code pass, the code pass is skipped, the write is completed, and the fw_col1 interrupt is issued. the bit flash66z (see i/o ram table) defines the speed for accessing flash memory. to minimize supply current draw, this bit should be set to 1. flash erasure is initiated by writing a specific data pattern to specific sfr registers in the proper sequence. these special pattern/sequence requirements prevent inadvertent erasure of the flash memory. the mass erase sequence is: 1. write 1 to the flsh_meen bit (sfr address 0xb2[1]. 2. write pattern 0xaa to flsh_erase (sfr address 0x94) the mass erase cycle can only be initiated when the ice port is enabled. the page erase sequence is: 1. write the page address to flsh_pgadr (sfr address 0xb7[7:1] 2. write pattern 0x55 to flsh_erase (sfr address 0x94) the mpu may write to the flash memory. this is one of the non - volatile storage options available to the user in addition to external eeprom. flsh_pwe (flash program write enable) differentiates 80515 data store instructions (movx@dptr,a) between flash and xram writes. updating individual bytes in flash memory: the original state of a flash byte is 0xff (all ones). once, a value other than 0xff is written to a flash memory cell, over writing with a different value usually requires that the cell is erased first. since cells cannot be erased individually, the page has to be copied to ram, followed by a page erase. after this, the page can be updated in ram and then written back to the flash memory. mpu ram: the 71m 6521de/dh/fe includes 2k - bytes of static ram memory on - chip (xram) plus 256 - bytes of internal ram in the mpu core. the 2k - bytes of static ram are used for data storage during normal mpu operations. ce dram : the ce dram is the working data memory of the ce (128 32 - bit words). the mpu can read and write the ce dram as the primary means of data communication between the two processors.
71m6521de/dh/fe data sheet page: 40 of 107 re v 2 optical interface the device includes an interface to implement an ir/optical port. the pin opt_tx is d esigned to directly drive an external led for transmitting data on an optical link. the pin opt_rx is designed to sense the input from an external photo detector used as the receiver for the optical link. these two pins are connected to a dedicated uart po rt (uart1). the opt_tx and opt_rx pins can be inverted with configuration bits opt_txinv and opt_rxinv , respectively. additionally, the opt_tx output may be modulated at 38khz. modulation is available when system power is present (i.e. not in brownout m ode). the opt_txmod bit enables modulation. duty cycle is controlled by opt_fdc[1:0] , which can select 50%, 25%, 12.5%, and 6.25% duty cycle. 6.25% duty cycle means opt_tx is low for 6.25% of the period. figure 7 illustrates the opt_tx generator. figure 7 : optical interface when not needed for the optical uart, the opt_tx pin can alternatively be configured as dio2, wpulse, or varpulse. the configuration bits are opt_txe[1:0] . likewise, opt_rx can alternately be configured as dio_1. its control is opt_rxdis. digital i/o the d evice includes up to 18 pins (qfn 68 package) or 14 pins (lqfp 64 package) of general purpose digital i/o. these pins are compatible with 5 v inputs (no current - limiting resistors are needed). some of them are dedicated dio (dio3), some are dual - function that can alternatively be used as lcd drivers (dio4 - 11, 14- 17, 19- 21) and some share functions with the optical port (dio1, dio2). on reset or power - up, all dio pins are inputs until they are configured for the desired direction under mpu control. the pin s are configured by the dio registers and by the five bits of the lcd_num register (located in i/o ram). once declared as dio, each pin can be con figured independently as an input or output with the dio_dirn bits. a 3 - bit configuration word, dio_rx , can b e used for certain pins, when configured as dio, to indivi dually assign an internal resource such as an interrupt or a timer control. table 54 lists the direction registers and configurability associated with each group of dio pins. table 55 shows the con figuration for a dio pin through its associated bit in its dio_dir register. tables showing the relationship between lcd_num and the available segment/dio pins can be found in the applications section and in the i/o ram description under lcd_num[4:0]. b a opt_txinv from opt_tx uart mod en duty opt_tx opt_txmod opt_fdc opt_txe[1:0] 1 2 v3p3 internal a b opt_txmod=0 opt_txmod=1, opt_fdc=2 (25%) b a 1/38khz 0 2 3 dio2 wpulse varpulse
71m6521de/dh/fe data sheet re v 2 page: 41 of 107 dio pb 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 pin no. (64 lqfp) 62 57 3 - 37 38 39 40 41 42 43 44 -- -- 20 21 pin no. (68 qfn) 65 60 3 5 39 40 41 42 43 44 45 46 -- -- 21 22 data register 0 1 2 3 4 5 6 7 0 1 2 3 -- -- 6 7 dio0=p0 (sfr 0x80) dio1=p1 (sfr 0x90) direction re gister 0 1 2 3 4 5 6 7 0 1 2 3 -- -- 6 7 dio_dir0 (sfr 0xa2) dio_dir1 (sfr 0x91) internal re sources con figurable y y y y y y y y y y y y -- -- -- -- dio 16 17 18 19 20 21 22 23 pin no. (64 lqfp) 22 12 -- -- -- -- -- -- pin no. (68 qfn) 23 13 -- 24 47 68 data register 0 1 -- 3 4 5 -- -- dio2=p2 (sfr 0xa0) direction re gister 0 1 -- 3 4 5 -- -- dio_dir2 (sfr 0xa1) internal re sources con figurable n n -- n n n -- -- table 54 : data/direction registers and internal resources for dio pin groups dio_dir [n] 0 1 dio pin n function input output table 55: dio_dir control bit additionally, if dio6 and dio7 are declared outputs, they can be configured as dedicated pulse outputs (wpulse = dio6, varpulse = dio7) using dio_pw and dio_pv registers. in this case, dio6 and dio7 are under ce control. dio4 and dio5 can be configured to implement the eeprom interface. the pb pin is a dedicated digital input. if the optical uart is not used, opt_tx and opt_rx can be configured as dedicated dio pins (dio1, dio2, see optical interface section). a 3 - bit configuration word, i/o ram register, d io_rx (0x2009[2:0] through 0x200e[6:4]) can be used for certain pins, when configured as dio, to indivi dually assign an internal resource such as an interrupt or a timer control (see table 54 for dio pins available for this option). this way, dio pins can be tracked even if they are configured as outputs. tracking dio pins configured as outputs is useful for pulse counting witho ut external hardware. when driving leds, relay coils etc., the dio pins should sink the current into gndd (as shown in figure 8 , right), not source it from v3p3d (as shown in figure 8 , left). this is due to the resistance of the internal switch that connects v3p3d to either v3p3sys or vbat. when configured as inputs, the dual - function (dio/seg) pins should not be pulled above v3p3sys in mission and above vbat in lcd and brownout modes. doing so will distort the lcd waveforms of the other pins. this limitation applies to any pin that can be co nfigured as a lcd driver. the control resources selectable for the dio pins are listed in table 56 . if more than one input is connected to the same resource, the reso urces are combined using a logical or. the pb pin is a dedicated digital input. in addition, if the optical uart is not used, opt_tx and opt_rx can be configured as dedicated dio pins. thus, in addition to the 16 general - purpose dio pins (dio4?dio11, dio14 ?dio21), there are three additional pins that can be used for digital input and output.
71m6521de/dh/fe data sheet page: 42 of 107 re v 2 recommended r led dio1 v3p3d 71m6521 v3p3sys dgnd vbat 3.3v recommended r led dio1 v3p3d 71m6521 v3p3sys dgnd vbat 3.3v figure 8 : connecting an external load to dio pins dio_r value resource selected for dio pin 0 none 1 reserved 2 t0 (counter0 clock) 3 t1 (counter1 clock) 4 high priority i/o interrupt (int0 rising) 5 low priority i/o interrupt (int1 rising) 6 high priority i/o interrupt (int0 falling) 7 low priority i/o interrupt (int1 falling) table 56 : selectable controls using the dio_dir bits lcd drivers the device in the 68 - pin qfn package contains 20 dedicated lcd segment drivers in addition to the 18 multi - use pins described above. thus, the device is capable of driving between 80 to 152 pixels of lcd display with 25% duty cycle (or 60 to 114 pixels with 33% duty cycle). at eight pixels per digit, this corresponds to 10 to 19 digits. the device in the 64 - pin lqfp package contains 20 dedicated lcd segment drivers in addition to the 15 multi - use pin s described above. thus, the device is capable of driving between 80 to 140 pixels of lcd display with 25% duty cycle (or 60 to 105 pixels with 33% duty cycle). at eight pixels per digit, this corresponds to 10 to 17 digits. the lcd drivers are grouped in to four commons and up to 38 segment drivers (68 - pin package), or 4 commons and 35 segment drivers (64 - pin package). the lcd interface is flexible and can drive either digit segments or enunciator symbols. segment drivers seg18 and seg19 can be configured to blink at either 0.5hz or 1hz. the blink rate is controlled by lcd_y . there can be up to four pixels/segments connected to each of these drivers. lcd_blkmap18[3:0] and lcd_blkmap19[3:0] identify which pixels, if any, are to blink. lcd interface memory i s powered by the non - volatile supply . the bits of the lcd memory are preserved in lcd and sleep modes, even if their pin is not configured as seg. in this case, they can be useful as general - purpose nonvolatile storage. battery monitor the battery voltage is measured by the adc during alternative mux frames if the bme (battery measure enable) bit is set. while bme is set, an on - chip 45k ? load resistor is applied to the battery and a scaled fraction of the battery voltage is applied to the adc input. after each alternative mux frame, the result of the adc conversion is available at ce dram address 0x07. bme is ignored and assumed zero when system power is not available. see the battery monitor section of the electrical specification section for details rega rding the adc lsb size and the conversion accuracy. not recommended 71m6521 dio1 r v3p3d led v3p3sys 3.3v dgnd vbat 71m6521 dio1 r v3p3d led v3p3sys 3.3v dgnd vbat
71m6521de/dh/fe data sheet re v 2 page: 43 of 107 eeprom interface the 71m 6521de/dh/fe provides hardware support for either type of eeprom interface, a two - pin interface and a three - pin interface. the interfaces use the eectrl and eedata regist ers for communication. two - pin eeprom interface the dedicated 2 - pin serial interface communicates with external eeprom devices. the interface is multiplexed onto pins dio4 (sck) and dio5 (sda) controlled by the dio_eex bit i/o ram (see i/o ram table). th e mpu communicates with the interface through two sfr registers: eedata and eectrl . if the mpu wishes to write a byte of data to eeprom, it places the data in eedata and then writes the ?transmit? command (cmd = 0011) to eectrl . this initiates the transmit operation. the transmit operation is finished when the busy bit falls. interrupt int5 is also asserted when busy falls. the mpu can then check the rx_ack bit to see if the eeprom acknowledged the transmission. a byte is read by writing the ?receive? command (cmd = 0001) to eectrl and waiting for the busy bit to fall. upon comple tion, the received data is in eedata . the serial transmit and receive clock is 78khz during each transmission, and the clock is held in a high state u ntil the next transmission. the bits in eectrl are shown in table 57 . the eeprom interface can also be operated by controlling the dio4 and dio5 pins directly (?bit - banging?). however, con trolling dio4 and dio5 directly is discouraged, because it may tie up t he mpu to the point where it may become too busy to process interrupts . status bit name read/ write reset state polarity description 7 error r 0 positive 1 when an illegal command is received. 6 busy r 0 positive 1 when serial data bus is busy. 5 rx_ack r 1 negative 0 indicates that the eeprom sent an ack bit. 4 tx_ack r 1 negative 0 indicates when an ack bit has been sent to the eeprom 3 -0 cmd[3:0 ] w 0 positive, see cmd table cmd operation 0000 no - op. applying the no- op command will stop t he i 2 c clock (sck, dio4). failure to issue the no - op command will keep the sck signal toggling. 0001 receive a byte from eeprom and send ack. 0011 transmit a byte to eeprom. 0101 issue a ?stop? sequence. 0110 receive the last byte from eeprom, do not send ack. 1001 issue a ?start? sequence. others no operation, set the error bit. table 57: eectrl status bits
71m6521de/dh/fe data sheet page: 44 of 107 re v 2 three - wire eeprom interface a 500khz three - wire interface, using sdata, sck, and a dio pin for cs is available. the interface is selected with dio_eex =3. the same 2 - wire eectrl register is used, except the bits are reconfigured, as shown in table 58 . when eectrl is written, up to 8 bits from eedata are either written to the eeprom or read from the eeprom, depending on the values of the eectrl bits. control bit name read/write description 7 wfr w wait for ready. if this bit is set, the trailing edge of busy will be de layed until a rising edge is seen on the data line. this bit can be used during the last byte of a write command to cause the int5 interrupt to occur when the eeprom has finished its internal write sequence. this bit is ignored if hiz=0. 6 busy r asserted while serial data bus is busy. when the busy bit falls, an int5 interrupt occurs. 5 hiz w indicates that the sd signal is to made high impedance immedi ately after the last sck rising edge. 4 rd w indicates that eedata is to be filled with data from eeprom. 3 -0 cnt [3:0] w specifies the number of clocks to be issued. allowed values are 0 through 8. if rd=1, cnt bits of data will be read msb first, and right justified into the low order bits of eedata . if rd=0, cnt bits will be sent msb first to eeprom, shifted out of eeda ta?s msb. if cnt is zero, sdata will simply obey the hiz bit. table 58: eectrl bits for 3 - wire interface the timing diagrams in figure 9 through figure 13 describe the 3 - wire eeprom interface behavior. all commands begin when the eectrl register is written. transactions start by first raising the dio pin that is connected to cs. multiple 8 - bit or less commands such as those shown in figure 9 through figure 13 are then sent via eectrl and eedata . when the transaction is finished, cs must be lowered. at the end of a read transaction, the eeprom will be driving sdata, but will transition to hiz (high impedance) when cs falls. the firmware should then immediately issue a write command with cnt=0 and hiz=0 to take control of sdata and force it to a low - z state. figure 9 : 3 - wire interface. write command, hiz=0. figure 10: 3 - wire interface. write command, hiz=1 sclk (output) busy (bit) cnt cycles (6 shown) sdata (output) write -- no hiz d2 d3 d4 d5 d6 d7 eectrl byte written int5 sdata output z (loz) cnt cycles (6 shown) write -- with hiz int5 eectrl byte written sclk (output) busy (bit) sdata (output) d2 d3 d4 d5 d6 d7 (hiz) (loz) sdata output z
71m6521de/dh/fe data sheet re v 2 page: 45 of 107 figure 11: 3 - wire interface. read command. figure 12: 3 - wire interface. write command when cnt=0 figure 13: 3 - wire interface. write command when hiz=1 and wfr=1. cnt cycles (8 shown) read d0 d1 d2 d3 d4 d5 int5 d6 d7 eectrl byte written sclk (output) busy (bit) sdata (input) sdata output z (hiz) cnt cycles (0 shown) write -- no hiz d7 int5 not issued cnt cycles (0 shown) write -- hiz int5 not issued eectrl byte written eectrl byte written sclk (output) busy (bit) sdata (output) sclk (output) busy (bit) sdata (output) (hiz) sdata output z sdata output z (loz) cnt cycles (6 shown) write -- with hiz and wfr eectrl byte written sclk (output) busy (bit) sdata (out/in) d2 d3 d4 d5 d6 d7 busy ready (from eeprom) int5 (from 6520) sdata output z (hiz) (loz)
71m6521de/dh/fe data sheet page: 46 of 107 re v 2 hardware watchdog timer in addition to the basic watchdog timer included in the 80515 mpu, an independent, robust, fixed - duration, watchdog timer (wdt) is included in the device. it uses the rtc crystal osc illator as its time base and must be refreshed by the mpu firmware at least every 1.5 seconds. when not refreshed on time the wdt overflows, and the part is reset as if the reset pin were pulled high, except that the i/o ram bits will be in the same state as after a wake - up from sleep or lcd modes ( see the i/o ram description for a list of i/o ram bit states after reset and wake - up) . 4100 oscillator cycles (or 125ms) after the wdt overflow, the mpu will be launched from program address 0x0000. a status bi t, wd_ovf , is set when wdt overflow occurs. this bit is powered by the non - volatile supply and can be read by the mpu to determine if the part is initializing after a wdt overflow event or after a power - up. after it is read, mpu firmware must clear wd_ovf . the wd_ovf bit is cleared by the reset pin there is no internal digital state that deactivates the wdt. for debug purposes, how ever, the wdt can be disabled by tying the v1 pin to v3p3 (see figure 39 ). of course, this also deactivates v1 power fault detection. since there is no method in firmware to disable the crystal oscillator or the wdt, it is guaranteed that whatever stat e the part might find itself in, upon wdt overflow, the part will be reset to a known state. asserting ice_e will also deactivate the wdt. this is the only method that will disable the wdt in brownout mode. in normal operation, the wdt is reset by periodi cally writing a one to the wdt_rst bit. the watchdog timer is also reset when the internal signal wake=0 (see section on wake up behavior). figure 14: functions defined by v1 program security when enabled, the security feature limits the ice to global flash erase operations only. all other ice operations are blocked. this guarantees the security of the user?s mpu and ce program code. security is enabled by mpu code that is executed in a 32 cycle preboot interval before the prima ry boot sequence begins. once security is enabled, the only way to disable it is to perform a global erase of the flash, followed by a chip reset. the first 32 cycles of the mpu boot code are called the preboot phase because during this phase the ice is in hibited. a read - only status bit, preboot , identifies these cycles to the mpu. upon completion of preboot, the ice can be enabled and is permitted to take control of the mpu. secure , the security enable bit, is reset whenever the chip is reset. hardware ass ociated with the bit permits only ones to be written to it. thus, preboot code may set secure to enable the security feature but may not reset it. once secure is set, the preboot code is protected and no external read of program code is possible specifica lly, when secure is set: ? the ice is limited to bulk flash erase only. ? page zero of flash memory, the preferred location for the user?s preboot code, may not be page - erased by either mpu or ice. page zero may only be erased with global flash erase. ? writes to page zero, whether by mpu or ice are inhibited. the secure bit is to be used with caution! inadvertently setting this bit will inhibit access to the part via the ice interface, if no mechanism for actively resetting the part between reset and erase ope rations is provided (see ice interface description). v3p3 v3p3 - 400mv v3p3 - 10mv vbias 0v battery modes normal operation, wdt enabled wdt dis- abled v1
71m6521de/dh/fe data sheet re v 2 page: 47 of 107 test ports tmuxout pin: one out of 16 digital or 8 analog signals can be selected to be output on the tmuxout pin. the function of the multiplexer is controlled with the i/o ram register tmux (0x20aa[4:0]), as shown in table 59. tmux [4:0] mode function 0 analog dgnd 1 analog reserved 2 analog dgnd 3 - 5 analog reserved 6 analog vbias 7 analog not used 8 - 0x0f -- reserved 0x10 ? 0x13 -- not used 0x14 digital rtm (real time output from ce) 0x15 digital wdtr_en (comparator 1 output and v1lt3) 0x16 ? 0x17 not used 0x18 digital rxd (from optical interface, w/ optional inversion) 0x19 digital mux_sync 0x1a digital ck_10m (10mhz clock) 0x1b digital ck_mpu (mpu clock) 0x1c -- reserved 0x1d digital rtclk (output of the oscillator circuit, nominally 32,786hz) 0x1e digital ce_busy (busy interrupt generated by ce, 396s) 0x1f digital xfer_busy (transfer busy interrupt generated by ce, nominally every 999.7ms) table 59: tmux [4:0] selections
71m6521de/dh/fe data sheet page: 48 of 107 re v 2 functional descripti on theory of operation the energy delivered by a power source into a load can be expressed as: = t dt t i t v e 0 ) ( ) ( assuming phase angles are constant, the following formulae apply: ? p = real energy [wh] = v * a * cos * t ? q = reactive energy [varh] = v * a * sin * t ? s = apparent energy [vah] = 2 2 q p + for a practical meter, not only voltage and current amplitudes, but also phase angles and harmonic content may change constantly. thus, simple rms measurements are inherently inaccurate. a modern solid - state electricity meter ic such as the teridian 71m 6521de/dh/fe functions by emulating the integral operation above, i.e. it processes current and voltage samples through an adc at a constant frequency. as long as the adc resolution is high enough and the sample frequency is beyond the harmonic range of interest, the current and voltage samples, multiplied with the time period of sampling will yield an accurate quantity for the momentary energy. summing up the momentary energy quantities over time will result in accumulated energy. figure 15: voltage. current, momentary and accumulated energy figure 15 shows the shapes of v(t), i(t), the momentary power and the accumulated power, resulting from 50 samples of the voltage and current signals over a period of 20ms. the application of 240vac and 100a results in an accumulation of 480ws (= 0.133wh) over the 20ms period, as indicated by the accumulated power curve. the described sampling method works reliably, ev en in the presence of dynamic phase shift and harmonic distortion. -500 -400 -300 -200 -100 0 100 200 300 400 500 0 5 10 15 20 current [a] voltage [v] energy per interval [ws] accumulated energy [ws]
71m6521de/dh/fe data sheet re v 2 page: 49 of 107 system timing summary figure 16 summarizes the timing relationships between the input mux states, the ce_busy signal, and the two serial output streams. in this example, mux_div =4 and fir_len =1 (384). the duration of each mux frame is 1 + mux_div * 2 if fir_len =288, and 1 + mux_div * 3 if fir_len =384. an adc conversion will always consume an integer number of ck32 clocks. followed by the conversions is a single ck32 cycle where the bandgap voltage is allowed to recover f rom the change in cross. each ce program pass begins when adc0 (channel ia) conversion begins. depending on the length of the ce program, it may continue running until the end of the adc3 (vb) conversion. ce opcodes are constructed to ensure that all ce code passes consume exactly the same number of cycles. the result of each adc conversion is inserted into the ce dram when the conversion is complete. the ce code is written to tolerate sudden changes in adc data. the exact ck count when each adc value is loaded into dram is shown in figure 16. figure 16 also shows that the serial rtm data stream begins transmitting at the beginning of state ?s.? rtm, consisting of 140 ck cycles, will always finish before the next code pass starts. figure 16 : timing relationship between adc mux, compute engine, and serial transfers. cktest tmuxout/rtm flag rtm data0 (32 bits) lsb sign lsb sign rtm data1 (32 bits) lsb lsb sign sign rtm data2 (32 bits) rtm data3 (32 bits) 0 1 30 31 0 1 30 31 0 1 30 31 0 1 30 31 flag flag flag mux_sync ck32 figure 17 : rtm output format ck32 mux state 0 mux_div conversions, mux_div =1 (4 conversions) is shown settle adc mux frame adc execution s mux_sync s ce_execution rtm 140 max ck count 0 450 150 900 1350 1800 adc0 adc1 adc2 adc3 ck count = ce_cycles + floor((ce_cycles + 2) / 5) notes: 1. all dimensions are 5mhz ck counts. 2. the precise frequency of ck is 150*crystal frequency = 4.9152mhz. 3. xfer_busy occurs once every (presamps * sum_cycles) code passes. ce_busy xfer_busy initiated by a ce opcode at end of sum interval adc timing ce timing rtm timing 1 2 3
71m6521de/dh/fe data sheet page: 50 of 107 re v 2 battery modes shortly after system power (v3p3sys) is applied, the pa rt will be in mission mode. mission mode means that the part is operating with system power and that the internal pll is stable. this mode is the normal operation mode where the part is capable of measuring energy. when system power is not available (i.e. when v1 71m6521de/dh/fe data sheet re v 2 page: 51 of 107 circuit function system power battery power (non - volatile supply) mission brownout lcd sleep ce yes -- -- -- ce data ram yes yes -- -- fir yes -- -- -- analog circuits: pll, adc, vref, bme etc yes -- -- -- mpu clock rate 4.92mhz (from pll) 28.672khz (7/8 of 32768hz) -- -- mpu_div yes -- -- -- ice yes yes -- -- dio pins yes yes -- -- watchdog timer yes yes -- -- lcd yes yes yes -- eeprom interface (2 - wire) yes yes (8kb/s) -- -- eeprom interface (3 - wire) yes yes (16kb/s) -- -- uart yes yes -- -- optical tx modulation yes -- -- -- flash read yes yes -- -- flash page erase yes yes -- -- flash write yes -- -- -- ram read and write yes yes -- -- wakeup timer yes yes yes yes oscillator and rtc yes yes yes yes dram data preservation yes yes -- -- v3p3d voltage output pin yes yes -- -- table 60 : available circuit functions (? ? ? means ?not active) brownout mode in brownout mode, most non - metering digital functions, as shown in table 60 , are active, including ice, uart, eeprom, lcd, and rtc. in brown out mode, a low bias cur rent regulator will provide 2.5 volts to v2p5 and v2p5nv. the regulator has an output called bat_ok to indicate that it has sufficient overhead. when bat_ok = 0, the part will enter sleep mode. from brownout mode, the mpu can voluntarily enter lcd or sleep modes. when system power is re stored, the part will automatically transition from any of the battery modes to mission mode, once the pll has settled. the mpu will run at crystal clock rate in brownout. the value of mpu_div will be remembered (not changed) as the part enters and exits brownout. mpu_div will be ignored during brownout. while pll_ok = 0, the i/o ram bits adc_e and ce_e are held in zero state disabling both adc and ce. when pll_ok falls, the ce program counter is cleared immediately and all fir processing halts. figure 19 shows the functional blocks active in brownout mode.
71m6521de/dh/fe data sheet page: 52 of 107 re v 2 figure 18 : operation modes state diagram lcd mode in lcd mode, the data contained in the lcd_seg registers is displayed, i.e. up to four lcd segments connected to each of the pins seg18 and seg19 can be made to blink without the involvement of the mpu, which is disabled in lcd mode. this mode can be exited only by system power up, a timeout of the wake - up timer, or a push button. figure 20 shows the functional blocks active in lcd mode. sleep mode in sleep mode, the battery current is minimized and only the oscillator and rtc functions are active. this mode can be exited only by system power - up, a timeout of the wake- up timer, or a push button event. figure 21 shows the functional blocks active in sleep mode. v3p3sys rises v3p3sys falls mission brownout lcd sleep or v1 > vbias v1 <= vbias lcd_only reset & vbat_ok reset ie_pllrise -> 1 ie_pllfall -> 1 ie_pb -> 1 ie_wake -> 1 pb timer timer pb reset & v3p3sys rises v3p3sys rises vbat_ok vbat_ok vbat_ok vbat_ok sleep
71m6521de/dh/fe data sheet re v 2 page: 53 of 107 figure 19 : functional blocks in brownout mode (inactive blocks grayed out) ia va mux xin xout vref ckadc cktest/ seg19 ce 32 bit compute engine mpu (8051) ce control opt_rx/ dio1 opt_tx/ dio2/ wpulse/ varpulse reset vbias v1 emulator port ce_busy optical uart tx rx xfer busy com0..3 vlc2 lcd display driver data 00-7f prog 000-7ff data 0000-ffff prog 0000-7fff 0000- 7fff mpu xram (2kb) 0000-07ff digital i/o config 2000-20ff i/o ram ce ram (0.5kb) memory share 1000-11ff rtclk rtclk (32khz) mux_sync ckce ckmpu ck32 ce_e rtm_e comp_stat power fault lcd_e lcd_clk lcd_mode dio 4.9 mhz < 4.9mhz 4.9 mhz gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 mpu_div sum_cycles pre_samps equ ckout_e 32khz tmuxout mpu_rstz faultz wake tmux[4:0] configuration parameters gnda vbias december 11, 2006 cross ck_gen osc (32khz) ck32 ckout_e mck pll vref vref_dis div adc mux ctrl mux_div chop_e equ strt ib mux mux ckfir 4.9 mhz rtm seg34/dio14 .. seg37/dio17 wpulse varpulse wpulse varpulse test test mode lcd_mode vlc1 vlc0 lcd_e < 4.9mhz lcd_num dio_r dio_dir lcd_num dio_pv/pw mux_alt seg24/dio4 .. seg31/dio11 sdck sdout sdin e_rxtx/seg38 e_tclk/seg33 e_rst/seg32 flash (16/32kb) flsh66zt v3p3a fir_len fir seg0..18 eeprom interface dio_eex ck_2x eck_dis opt_txe v3p3d lcd_gen x4mhz pb rtc rtc_inc_sec rtc_dec_sec vb vbias memory share seg32,33 seg19,38 e_rxtx e_tclk e_rst (open drain) ice_e dio1,2 vref_cal ? adc converter + - vref adc_e rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv opt_txinv opt_rxinv opt_rxdis lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux dio3, dio19/seg39, dio20/seg40, dio21/seg41 (68 pin package only) v3p3d temp vbat vbat mod opt_txmod opt_fdc ce_lctn
71m6521de/dh/fe data sheet page: 54 of 107 re v 2 figure 20 : functional blocks in lcd mode (inactive blocks grayed out) ia va mux xin xout vref ckadc cktest/ seg19 ce 32 bit compute engine mpu (8051) ce control opt_rx/ dio1 opt_tx/ dio2/ wpulse/ varpulse reset vbias v1 emulator port ce_busy optical uart tx rx xfer busy com0..3 vlc2 lcd display driver data 00-7f prog 000-7ff data 0000-ffff prog 0000-7fff 0000- 7fff mpu xram (2kb) 0000-07ff digital i/o config 2000-20ff i/o ram ce ram (0.5kb) memory share 1000-11ff rtclk rtclk (32khz) mux_sync ckce ckmpu ck32 ce_e rtm_e comp_stat power fault lcd_e lcd_clk lcd_mode dio 4.9 mhz < 4.9mhz 4.9 mhz gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 mpu_div sum_cycles pre_samps equ ckout_e 32khz tmuxout mpu_rstz faultz wake tmux[4:0] configuration parameters gnda vbias december 11, 2006 cross ck_gen osc (32khz) ck32 ckout_e mck pll vref vref_dis div adc mux ctrl mux_div chop_e equ strt ib mux mux ckfir 4.9 mhz rtm seg34/dio14 .. seg37/dio17 wpulse varpulse wpulse varpulse test test mode lcd_mode vlc1 vlc0 lcd_e < 4.9mhz lcd_num dio_r dio_dir lcd_num dio_pv/pw mux_alt seg24/dio4 .. seg31/dio11 sdck sdout sdin e_rxtx/seg38 e_tclk/seg33 e_rst/seg32 flash (16/32kb) flsh66zt v3p3a fir_len fir seg0..18 eeprom interface dio_eex ck_2x eck_dis opt_txe v3p3d lcd_gen x4mhz pb rtc rtc_inc_sec rtc_dec_sec vb vbias memory share seg32,33 seg19,38 e_rxtx e_tclk e_rst (open drain) ice_e dio1,2 vref_cal ? adc converter + - vref adc_e rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv opt_txinv opt_rxinv opt_rxdis lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux dio3, dio19/seg39, dio20/seg40, dio21/seg41 (68 pin package only) v3p3d temp vbat vbat mod opt_txmod opt_fdc ce_lctn
71m6521de/dh/fe data sheet re v 2 page: 55 of 107 figure 21 : functional blocks in sleep mode (inactive blocks grayed out) ia va mux xin xout vref ckadc cktest/ seg19 ce 32 bit compute engine mpu (8051) ce control opt_rx/ dio1 opt_tx/ dio2/ wpulse/ varpulse reset vbias v1 emulator port ce_busy optical uart tx rx xfer busy com0..3 vlc2 lcd display driver data 00-7f prog 000-1ff data 0000-ffff prog 0000-7fff 0000- 7fff mpu xram (2kb) 0000-07ff digital i/o config 2000-20ff i/o ram ce ram (0.5kb) memory share 1000-11ff rtclk rtclk (32khz) mux_sync ckce ckmpu ck32 ce_e rtm_e comp_stat power fault lcd_e lcd_clk lcd_mode dio 4.9 mhz < 4.9mhz 4.9 mhz gndd v3p3a v3p3d vbat volt reg 2.5v to logic v2p5 mpu_div sum_cycles pre_samps equ ckout_e 32khz tmuxout mpu_rstz faultz wake tmux[4:0] configuration parameters gnda vbias december 11, 2006 cross ck_gen osc (32khz) ck32 ckout_e mck pll vref vref_dis div adc mux ctrl mux_div chop_e equ strt ib mux mux ckfir 4.9 mhz rtm seg34/dio14 .. seg37/dio17 wpulse varpulse wpulse varpulse test test mode lcd_mode vlc1 vlc0 lcd_e < 4.9mhz lcd_num dio_r dio_dir lcd_num dio_pv/pw mux_alt seg24/dio4 .. seg31/dio11 sdck sdout sdin e_rxtx/seg38 e_tclk/seg33 e_rst/seg32 flash (16/32kb) flsh66zt v3p3a fir_len fir seg0..18 eeprom interface dio_eex ck_2x eck_dis opt_txe v3p3d lcd_gen x4mhz pb rtc rtc_inc_sec rtc_dec_sec vb vbias memory share seg32,33 seg19,38 e_rxtx e_tclk e_rst (open drain) ice_e dio1,2 vref_cal ? adc converter + - vref adc_e rtm_0..3 ce_lctn pls_maxwidth pls_interval pls_inv opt_txinv opt_rxinv opt_rxdis lcd_blkmap lcd_seg lcd_y sleep lcd_only v3p3sys test mux dio3, dio19/seg39, dio20/seg40, dio21/seg41 (68 pin package only) v3p3d temp vbat vbat mod opt_txmod opt_fdc ce_lctn
71m6521de/dh/fe data sheet page: 56 of 107 re v 2 figure 22 : transition from brownout to mission mode when system po wer returns figure 23 : power - up timing with v3p3sys and vbat tied together time system power (v3p3sys) mpu mode battery current transition mpu clock source xtal pll (4.2mhz/mux_div) pll_ok mission 2048...4096 ck32 cycles 300na 13..14 ck cycles wake brownout v1_ok time v3p3sys and vbat mpu mode battery current mpu clock source xtal pll (4.2mhz) pll_ok mission 300na wake internal resetz brown- out 1024 ck32 cycles 14.5 ck32 cycles 4096 ck32 cycles v1_ok
71m6521de/dh/fe data sheet re v 2 page: 57 of 107 figure 24 : power - up timing with vbat only fault and reset behavior reset mode: when the reset pin is pulled high all digital activity stops. the oscillator and rtc module continue to run. additionally, all i/o ram bits are set to their default states. as long as v1, the input voltage at the power fault block, is greater than vbias, the internal 2. 5 v regulator will continue to provide power to the digital section. once initiated, the reset mode will persist until the reset timer times out, signified by the internal signal wake rising. this will occur in 4100 cycles of the real time clock after reset goes low, at which time the mpu will begin executing its pre boot and boot sequences from address 00. see the security section for more description of preboot and boot. if system power is not present, the reset timer duration will be 2 c ycles of the crystal clock, at which time the mpu will begin executing in brownout mode, starting at address 00. power fault circuit: the 71m 6521de/dh/fe includes a comparator to monitor system power fault conditions. when the output of the comparator falls (v1 71m6521de/dh/fe data sheet page: 58 of 107 re v 2 wake on pb if the part is in sleep or lcd mode, it can be awakened by a rising edge on the pb pin. this pin is normally pulled to gnd and can be pulled high by a push button depre ssion. before the pb signal rises, the mpu is in reset due to the internal signal wake being low. when pb rises, wake rises and within three crystal cycles, the mpu begins to execute. the mpu can determine whether the pb signal woke it up by checking the i e_pb flag. for debouncing, the pb pin is monitored by a state machine operating from a 32hz clock. this circuit will reject between 31ms and 62ms of noise . detection hardware will ignore all transitions after the initial risi ng edge. this will continue until the mpu clears the ie_pb bit. figure 25 : wake up timing wake on timer if the part is in sleep or lcd mode, it can be awakened by the wake - up timer. until this timer times out, the mpu is in rese t due to wake being low. when the wake - up timer times out, the wake signal rises and within three crystal cycles, the mpu begins to execute. the mpu can determine whether the timer woke it by checking the autowake interrupt flag ( ie_wake ). the wake - up timer begins timing when the part enters lcd or sleep mode. its duration is controlled by wake_prd[2:0] and wake_res . wake_res selects a timer lsb of either 1 minute ( wake_res =1) or 2.5 seconds ( wake_res =0). wake_prd[2:0] selects a duration o f from 1 to 7 lsbs. the timer is armed by wake_arm =1. it must be armed at least three rtc cycles before sleep or lcd_only is initiated. setting wake_arm presets the timer with the values in wake_res and wake_prd and readies the timer to start when the m pu writes to sleep or lcd_only . the timer is reset and disarmed whenever the mpu is awake. thus, if it is de sired to wake the mpu periodically (every 5 seconds, for example) the timer must be rearmed every time the mpu is awakened. time system power (v3p3sys) mpu mode pll_ok 15 ck32 cycles wake lcd pb or wake- up timer brownout
71m6521de/dh/fe data sheet re v 2 page: 59 of 107 data flow the data flow between ce and mpu is shown in figure 26 . in a typical application, the 32 - bit compute engine (ce) se quen tially processes the samples from the voltage inputs on pins ia, va, ib, and vb, performing calculations to measure active power (wh), reactive power (varh), a 2 h, and v 2 h for four - quadrant metering. these measurements are then accessed by the mpu, processed further and output using the periph eral devices available to the mpu. figure 26: mpu/ce data flow ce/mpu communication figure 27 shows the functional relationship between ce and mpu. the ce is controlled by the mpu via shared registers in the i/o ram and by registers in the ce dram. the ce outputs two interrupt signals to the mpu: ce_busy and xfer_busy, which are connected to the mpu interrupt service inputs as external interrupts. ce_busy indicates that the ce is actively processing data. this signal will occur once every multiplexer cycle. xfer_busy indicates that the ce is updating data to the output region of the ce dram. this will occur whenever the ce has finished generating a sum by completing an accumulation interval determined by sum_cycles * pre_samps samples. interrupts to the mpu occur on the falling edges of the xfer_busy and ce_busy signals. figure 27: mpu/ce communication ce mpu pre - processor post - processor irq processed metering data pulses i/o ram (configuration ram) samples data mpu ce pulses interrupts display (me- mory-mapped lcd segments) dio eeprom (i2c) serial (uart0/1) samples var (dio7) w (dio6) varsum wsum adc ext_pulse ce_busy xfer_busy mux ctrl. data apulsew apulser sag control i/o ram (configuration ram)
71m6521de/dh/fe data sheet page: 60 of 107 re v 2 application informat ion connection of sensors (ct, resistive shunt) figure 28 and figure 29 show how resistive dividers, current transformers, and restive shunts are connected to the voltage and current inputs of the 71m 6521de/dh/fe . figure 28 : resistive voltage divider (left), current transformer (right) figure 29 : resistive shunt distinction between 71m6521de/71m652 1 fe and 71m65 21d h parts the 71m65 21dh (high - accuracy) part go through an additional process of characterization during production which makes them suitable to high - accuracy performance over temperature. the first process, applied to all p arts is the trimming of the reference voltage to the target value of 1.195 v. the second process, which is applied only to the high - accuracy parts, is the characterization of the reference vol tage over temperature. the coefficients for the reference vo ltage are stored in trim fuses (i/o ram reg isters trimbga , trimbgb , trimm[2:0] . the mpu can read these trim fuses and calculate the correction coefficients ppm1 and ppm c2 per the formulae given in vref, vbias section . see temperature compensation section for additional details. the fuse trimbgb is non - zero for the high - accuracy part s and zero for the regular part s . va = vin * r out /(r out + r in ) v in r in r out va
71m6521de/dh/fe data sheet re v 2 page: 61 of 107 temperature measurement measurement of absolute temperature uses the on - chip temperature sensor while applying the following formula: n n n t s n t n t + ? = ) ) ( ( in the above formula t is the temperature in c, n(t) is the adc count at temperature t, n n is the adc count at 25c, s n is the sensitivity in lsb/c as stated in the electrical specifications, and t n is +25c. example: at 25c a temperature sensor value of 518,203,584 (n n ) is read by the adc by a 71m6521fe in the 64 - pin lqfp package. at an unknown temperature t the value 449.648.000 is read at (n(t)). the absolute temperature is then de termined by dividing both n n and n(t) by 512 to account for the 9 - bit shift of the adc v alue and then inserting the results into the above formula, using ? 2220 for lsb/c: c c t = + ? ? = 3 . 85 25 ) 2220 ( 512 4 518,203,58 - 0 449.648.00 it is recommended to base temperature measurements on temp_raw_x which is the sum of two consecutive temperature readings thus being higher by a fact or of two than the raw sensor readings. temperature compensation temperature coefficients: the internal voltage reference is calibrated during device manufacture. for the 71m6521de/fe, t he temperature coefficients tc1 and tc2 are given as constants that r epresent typical com ponent behavior (in v/c and v/c 2 , respectively). for the 71m6521dh, the temperature characteristics of the chip are measured during production and then stored in the fuse registers trimbga , trimbgb , trim t and trimm [2:0] . tc1 and tc2 can be derived from the fuses by using the relations given in the electrical specifications section. since tc1 and tc2 are given in v/c and v/c 2 , respectively, the value of the vref voltage (1.19 5 v ) has to be taken into account when t ransitioning to ppm/c and ppm/c 2 . this means that ppmc = 26.84*tc1/1.195, and ppmc2 = 1374*tc2/1.195. close examination of the electrical specification (see table 61 ) for the parts with regular accuracy reveals that the achievable deviation is not strictly 40 ppm/c over the whole temperature range: only for temperatures for which t - 22 > 40 (i.e. t > 62c) or for which t - 22 < - 40 (i.e. t < - 18c), the data sheet states 40 ppm/c. for temperatures between - 18c and +62c, the error should be considered constant at 1,600 ppm, or 0.16%. similar considerations apply to the high - accuracy parts (see table 62 ), where the error around the calibration temperature should be considered constant at 8 00 ppm, or 0.0 8 %. p arameter c ondition m in t yp vref(t) deviation from vnom(t) ) 40 , 22 max( 10 ) ( ) ( ) ( 6 ? ? t t vnom t vnom t vref - 40 +40 ppm /oc table 61 : vref definition for the regular accuracy parts
71m6521de/dh/fe data sheet page: 62 of 107 re v 2 p arameter c ondition m in t yp vref(t) deviation from vnom(t) ) 40 , 22 max( 10 ) ( ) ( ) ( 6 ? ? t t vnom t vnom t vref - 20 + 20 ppm /oc table 62 : vref definition for the high - accuracy parts figure 30 and figure 31 show this concept graphical ly. the ?box? from - 18c to +62c reflects the fact that it is impractical to measure the temperature coefficient of high - quality references at small temperature excursions. for example, at +25c, the expected error would be 3c * 40 ppm/c, or just 0.012 % for the regular - accuracy parts.. the maximum deviation of 2520 ppm (or 0.252%) for the regular - accuracy parts is reached at the temperature extremes. if the reference voltage is used to measure both voltage and current, the identical errors of 0.252% a dd up to a maximum wh registration error of 0.504%. the maximum deviation of 1260 ppm (or 0. 126 %) for the high - accuracy parts is reached at the temperature extremes. if the reference voltage is used to measure both voltage and current, the identical erro rs of 0. 126 % add up to a maximum wh registration error of 0. 252 %. figure 30 : error band for vref over temperature (regular - accuracy parts) - 2800 - 2400 - 2000 - 1600 - 1200 - 800 - 400 0 400 800 1200 1600 2000 2400 2800 - 40 - 20 0 20 40 60 80 error band (ppm) over temperature ( c) 40 ppm/ c 40 ppm/ c
71m6521de/dh/fe data sheet re v 2 page: 63 of 107 figure 31 : error band for vref over temperature (high - accuracy parts) temperature compensation : t he ce provides the bandgap temperature to the mpu, which then may digitally com - pensate the power outputs for the temperature dependence of vref, using the ce register gain_adj . since the band gap amplifier is chopper - stabilized via the chop_en bits, the most significant long - term drift mechanism in the voltage reference is removed. the mpu, not the ce, is entirely in charge of providing temperature compensation. the mpu applies the following formula to determine gain_adj (address 0x12) . in this formula temp_x is the deviation from nominal or calibration temperature expressed in multiples of 0.1c: 23 2 14 2 2 _ 2 _ 16385 _ ppmc x temp ppmc x temp adj gain ? + ? + = in a production electricity meter, the 71m 6521de/d h/fe is not the only component contributing to temperature de - pendency. a whole range of components (e.g. current transformers, resistor dividers, power sources, filter capacitors) will contribute temperature effects. since the output of the on - chip temper ature sensor is accessible to the mpu, temperature - compensation mechanisms with great flexibility are possible. mpu access to gain_adj permits a system - wide temperature correction over the entire meter rather than local to the chip. - 1400 - 1000 - 600 - 200 200 600 1000 1400 - 40 - 20 0 20 40 60 80 error band (ppm) over temperature ( c) 20 ppm/ c 20 ppm/ c
71m6521de/dh/fe data sheet page: 64 of 107 re v 2 temperature compensation and mains frequency stabilization for the rtc the flexibility provided by the mpu allows for compensation of the rtc using the substrate temperature. to achieve this, the crystal has to be characterized over temperature and the three coefficie nts y_cal , y_calc , and y_cal_c2 have to be calculated. provided the ic substrate temperatures tracks the crystal temperature the coefficients can be used in the mpu firmware to trigger occasional corrections of the rtc seconds count, using the rtc_dec_sec or rtc_inc_sec registers in i/o ram. example: let us assume a crystal characterized by the measurements shown in table 63 : deviation from nominal temperature [c] measured frequency [hz] deviation from nominal frequency [ppm] +50 32767.98 - 0.61 +25 32768.28 8.545 0 32768.38 11.597 -25 32768.08 2.441 -50 32767.58 - 12.817 table 63 : frequency over temperature the values show that even at nominal temperature (the temperature at which the chip was calibrated for energy), the de viation from the ideal crystal frequency is 11.6 p pm, resulting in about one second inaccuracy per day, i.e. more than some standards allow. as figure 32 shows, even a constant compensation would not bring much improvement, since the temperature characteristics of the crystal are a mix of constant, linear, and quadratic effects. figure 32 : crystal frequency over temperature one method to correct the temperature characteristics of the crystal is to obtain coefficients from the curve in figure 32 by curve - fitting the ppm deviations. a fairly close curve fit is achieved with the coefficients a = 10.89, b = 0.122, and c = ? 0.00714 (see figure 33). ? ? ? ? ? ? + + + ? = 6 2 6 6 10 10 10 1 c t b t a f f nom when applying the inverted coefficients, a curve (see figure 33 ) will result that effectively neutralizes the original crystal characteristics. 32767.5 32767.6 32767.7 32767.8 32767.9 32768 32768.1 32768.2 32768.3 32768.4 32768.5 -50 -25 0 25 50
71m6521de/dh/fe data sheet re v 2 page: 65 of 107 figure 33 : crystal compensation the mpu demo code supplied with the teridian demo kits has a direct interface for these coefficients and it directly con trols the rtc_dec_sec or rtc_inc_sec registers. the demo code uses the coefficients in the form: 1000 2 _ 100 _ 10 _ ) ( 2 calc y t calc y t cal y ppm correction ? + ? + = note that the coefficients are scaled by 10, 100, a nd 1000 to provide more resolution. for our example case, the coefficients would then become (after rounding): y_cal = 109, y_calc = 12, y_calc2 = 7 alternatively, the mains frequency may be used to stabilize or check the function of the rtc. for this purpose, the ce provides a count of the zero crossings detected for the selected line voltage in the main_edge_x address. this count is equivalent to twi ce the line frequency, and can be used to synchronize and/or correct the rtc. connecting 5 v devices all digital input pins of the 71m 6521de/dh/fe are compatible with external 5 v devices. i/o pins configured as inputs do not require current -l imiting resistors when they are connected to external 5 v devices. 32767.5 32767.6 32767.7 32767.8 32767.9 32768 32768.1 32768.2 32768.3 32768.4 32768.5 -50 -25 0 25 50 crystal curve fit inverse curve
71m6521de/dh/fe data sheet page: 66 of 107 re v 2 connecting lcds the 71m 6521de/dh/fe has a lcd controller on - chip capable of controlling static or multiplexed lcds. figure 34 shows the basic connection for a lcd. figure 34 : connecting lcds the lcd segment pins can be organized in the following groups: 1. nineteen pins ar e dedicated lcd segment pins (seg0 to seg18). 2. four pins are dual - function pins cktest/seg19, e_rxtx/seg38, e_tclk/seg33, and e_rst/seg32. 3. twelve pins are available as combined dio and segment pins seg24/dio4 to seg31/dio11 and seg34/dio14 to seg37/dio17) 4. the qfn - 68 package adds the three combination pins seg39/dio19 to seg41/dio21. the split between dio and lcd use of the combined pins is controlled with the dio register lcd_num . lcd_num can be assigned any number between 0 and 18. the first dual - purpose p in to be allocated as lcd is seg41/dio21 (on the 68 - pin qfn package). thus if lcd_num =2, seg41 and seg 40 will be configured as lcd. the remaining seg39 to seg24 will be configured as dio19 to dio4. dio1 and dio2 are always available, if not used for the o ptical port. note that pins cktest/seg19, e_rxtx/seg38, e_tclk/seg33, and e_rst/seg32 are not affected by lcd_num . table 64 and table 65 show the allocation of dio and segment pins as a function of lcd_num for both package types. segments 6521 lcd commons
71m6521de/dh/fe data sheet re v 2 page: 67 of 107 lcd_num seg in addition to seg0 - seg18 total number of lcd segment pins in cluding seg0 - seg18 di o pins in addition to dio1 - dio2 total number of dio pins including dio1, dio2 0 none 19 4 - 11,14- 17, 19 -21 18 1 41 20 4 - 11, 14- 17, 19 -20 17 2 40-41 21 4 - 11, 14- 17, 19 16 3 39-41 22 4 - 11, 14- 17 15 4 39-41 22 4 - 11, 14- 17 15 5 37, 39 -41 23 4 - 11, 14- 16 14 6 36- 37, 39-41 24 4 - 11, 14- 15 13 7 35- 37, 39-41 25 4 - 11, 14 12 8 34- 37, 39-41 26 4 -11 11 9 34- 37, 39-41 26 4 -11 11 10 34- 37, 39-41 27 4 -11 11 11 31, 34 - 37, 39-41 27 4 -10 10 12 30- 31, 34- 37, 39-41 28 4 -9 9 13 29- 31, 34- 37, 39-41 29 4 -8 8 14 28- 31, 34- 37, 39-41 30 4 -7 7 15 27- 31, 34- 37, 39-41 31 4 -6 6 16 26- 31, 34- 37, 39-41 32 4 -5 5 17 25- 31, 34- 37, 39-41 33 4 4 18 24- 31, 34- 37, 39-41 34 none 3 note: lcd segment numbers are given without cktest/seg19, e_rxtx/seg38, e_tclk/seg33, and e_rst/seg32. table 64 : lcd and dio pin assignment by lcd_num for the qfn - 68 package
71m6521de/dh/fe data sheet page: 68 of 107 re v 2 lcd_num seg in addition to seg0 - seg18 total number of lcd segment pins in - cluding seg0 - seg18 dio pins in addition to dio1 - dio2 total number of dio pins including dio1, dio2 0 - 19 4 - 11, 14- 17 14 1 - 19 4 - 11, 14- 17 14 2 - 19 4 - 11, 14- 17 14 3 - 19 4 - 11, 14- 17 14 4 - 19 4 - 11, 14- 17 14 5 37 20 4 - 11, 14- 16 13 6 36-37 21 4 - 11, 14- 15 12 7 35-37 22 4 - 11, 14 11 8 34-37 23 4 -11 10 9 34-37 23 4 -11 10 10 34-37 23 4 -11 10 11 31, 34 -37 24 4 -10 9 12 30- 31, 34-37 25 4 -9 8 13 29- 31, 34-37 26 4 -8 7 14 28- 31, 34-37 27 4 -7 6 15 27- 31, 34-37 28 4 -6 5 16 26- 31, 34-37 29 4 -5 4 17 25- 31, 34-37 30 4 3 18 24- 31, 34-37 31 none 2 note: lcd segment numbers are given without cktest/seg19, e_rxtx/seg38, e_tclk/seg33, and e_rst/seg32. table 65 : lcd and dio pin assignment by lcd_num for the lqfp - 64 package connecting i 2 c eeproms i 2 c eeproms or other i 2 c compatible devices should be connected to the dio pins dio4 and dio5, as shown in figure 35 . pull - up resistors of roughly 10k ? to v3p3d (to ensure operation in brownout mode) should be used for both scl and sda signals. the dio_eex register in i/o ram must be set to 01 in order to convert the dio pins dio4 and dio5 to i 2 c pins scl and sda . figure 35: i 2 c eeprom connection dio4 dio5 71m6521 eeprom scl sda v3p3d 10k 10k dio4 dio5 71m6521 eeprom scl sda v3p3d 10k 10k
71m6521de/dh/fe data sheet re v 2 page: 69 of 107 connecting three - wire eeproms wire eeproms and other compatible devices should be connected to the dio pins dio4 and dio5, as shown in figure 36 . dio5 connects to both the di and do pins of the three- wire device. the cs pin must be connected to a vacant dio pin of the 71m 6521de/dh/fe . a pull - up resistor of roughly 10k ? to v3p 3d (to ensure operation in brownout mode) should be used for the di/do signals, and the cs pin should be pulled down with a resistor to prevent that the three - wire device is selected on power - up, before the 71m 6521de/dh/fe can establish a stable s ignal for cs. the dio_eex register in i/o ram must be set to 10 in order to convert the dio pins dio4 and dio5 to microwire pins. the pull - up resistor for dio5 may not be necessary. figure 36 : three - wire eeprom connection uart0 (tx/rx) the rx pin should be pulled down by a 10k ? resistor and additionally protected by a 100pf ceramic capacitor, as shown in figure 37. figure 37 : connections for the rx pin dio4 dio5 71m6521 eeprom sclk di v3p3d 10k cs dion do 10k dio4 dio5 71m6521 eeprom sclk di v3p3d 10k cs dion do 10k tx rx 71m6521e 10k 100pf rx tx tx rx 71m6521e 10k 100pf rx tx
71m6521de/dh/fe data sheet page: 70 of 107 re v 2 optical interface the pins opt_tx and opt_rx can be used for a regular serial interface, e.g. by connecting a rs_232 transceiver, or they can be used to directly operate optical components, e.g. an infrared diode and phototransistor implementing a flag interface. figure 38 shows the basic connections. the opt_tx pin becomes active when the i/o ram register opt_txdis is set to 0. the polarity of the opt_tx and opt_rx pins can be inverted with configuration bits opt_txinv and opt_rxinv , re spectively. the opt_tx output may be modulated at 38khz when system power is present. modulation is not available in brownout mode. the opt_txmod bit enables modulation. the duty cycle is controlled by opt_fdc[1:0] , which can select 50%, 25%, 12.5%, and 6.25% duty cycle. a 6.25% duty cycle means opt_tx is low for 6.25% of the period. the receive pin (opt_rx) may need an analog filter when receiving modulated optical signals. with modulation, an optical emitter can be operated at higher current than nominal, enabling it to increase the distance along the optical path. if operation in brownout mode is desired, the external components should be connected to v3p3d. figure 38 : connection for opt ical components connecting v1 and reset pins a voltage divider should be used to establish that v1 is in a safe range when the meter is in mission mode (v1 must be lower than 2.9v in all cases in order to keep the hardware watchdog timer enabled). for proper debugging or loading code into the 71m 6521de/dh/fe mounted on a pcb, it is necessary to have a provision like the header shown above r1 in figure 39 . a shorting jumper on this header pulls v1 up to v3p3 disabling the hardware watchdog timer. the parallel impedance of r1 and r2 should be approximately 20 to 30k ? in order to provide hystere sis for the power fault monitor. figure 39 : voltage divider for v1 opt_tx r 2 r 1 opt_rx 71m6521 v3p3sys phototransistor led 100k 100pf v3p3sys opt_tx r 2 r 1 opt_rx 71m6521 v3p3sys phototransistor led 100k 100pf v3p3sys v3p3 r 2 v1 r 1 r 3 5k c 1 100pf gnd v3p3 r 2 v1 r 1 r 3 5k c 1 100pf gnd
71m6521de/dh/fe data sheet re v 2 page: 71 of 107 r 1 reset 71m6521 dgnd 100 r 1 reset 71m6521 dgnd 100 even though a functional meter will not necessarily need a reset switch, it is useful to have a reset pushbutton for prototyping, as shown in figure 40 , left side. the reset signal may be sourced from v3p3sys (functional in mission mode only), v3p3d (mission and brownout modes), vbat (all modes, if battery is present), or from a combination of these sources, depending on the application. for a production meter, the reset pin should be protected by the external components shown in figure 40 , right side. r 1 should be in the range of 100 ? and mounted as closely as possible to the ic. since the 71m 6521de/dh/fe generates its own power - on reset, a reset button or circuitry, as shown in figure 40 , left side, is only required for test units and prototypes. figure 40 : external components for reset: development circuit (left), production circuit (righ t) connecting the emulator port pins capacitors to ground must be used for protection from emi. production boards should have the ice_e pin connected to ground. if the ice pins are used to drive lcd segments, the pull - up resistors should be omitted, as sho wn in figure 41 , and 22pf capacitors to gndd should be used for protection from emi. it is important to bring out the ice_e pin to the programming interface in order to create a way for reprogramming parts t hat have the flash secure bit (sfr 0xb2[6]) set. providing access to ice_e ensures that the part can be reset between erase and program cycles, which will enable programming devices to reprogram the part. the reset required is im plemented with a watchdog timer reset (i.e. the hardware wdt must be enabled). figure 41 : external components for the emulator interface crystal oscillator the oscillator of the 71m 6521de/dh/fe drives a standard 32.768khz watch crystal. the oscillator has been designed specifically to handle these crystals and is compatible with their high impedance and limited power handling capability. the oscillator power dissipation is very low to maximize t he lifetime of any battery backup device attached to vbat. r 1 reset 71m6521 dgnd v3p3d r 2 vbat/ v3p3d reset switch 1k 1nf 10k r 1 reset 71m6521 dgnd v3p3d r 2 vbat/ v3p3d reset switch 1k 1nf 10k e_rst 71m6521 e_rxtx e_tclk 62 62 62 22pf 22pf 22pf lcd segments (optional) ice_e v3p3d e_rst 71m6521 e_rxtx e_tclk 62 62 62 22pf 22pf 22pf lcd segments (optional) ice_e v3p3d
71m6521de/dh/fe data sheet page: 72 of 107 re v 2 board layouts with minimum capacitance from xin to xout will require less battery current. good layouts will have xin and xout shielded from each other. since the oscillator is self - biasing, an e xternal resistor must not be connected across the crystal. flash programming operational or test code can be programmed into the flash memory using either an in - circuit emulator or the teridian flash programmer module (tfp -1) . the flash programming procedure uses the e_rst, e_rxtx, and e_tclk pins. mpu firmware library all application - specific mpu functions mentioned above under ?application information? are available as a standard ansi c library and as ansi ?c? source code. the code is available as part of the demonstration kit for the 71m 6521de/dh/fe ic. the demonstration kits come with the 71m 6521de/dh/fe ic pre programmed with demo firmware mounted on a functional sample meter pcb (demo board). the demo boards allow for quick and efficient evaluation of the ic without having to write firmware or having to supply an in - circuit emulator (ice). meter calibration once the teridian 71m 6521de/dh/fe energy meter device has been installed in a mete r system, it has to be calibrated for tolerances of the current sensors, voltage dividers and signal conditioning components. the device can be calibrated using the gain and phase adjustment factors accessible to the ce. the gain adjustment is used to comp ensate for tolerances of components used for signal conditioning, especially the resistive components. phase adjustment is provided to compensate for phase shifts introduced by the current sensors. due to the flexibility of the mpu firmware, any calibratio n method, such as calibration based on energy, or current and voltage can be implemented. it is also possible to implement segment - wise calibration (depending on current range). the 71m 6521de/dh/fe supports common industry standard calibration techniques, such as single - point (energy - only), multi - point (energy, vrms, irms), and auto - calibration.
71m6521de/dh/fe data sheet re v 2 page: 73 of 107 firmware interface i/o ram map ? in numerical order ?not used? bits are grayed out, contain no memory a nd are read by the mpu as zero. reserved bits may be in use and should not be changed. this table lists only the sfr registers that are not generic 8051 sfr registers. name addr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 configuration: ce0 2000 equ[2:0] ce_e reserved ce1 2001 pre_samps[1:0] sum_cycles[5:0] ce2 2002 mux_div[1:0] chop_e[1:0] rtm_e wd_ovf ex_rtc ex_xfr comp0 2003 not used pll_ok not used reserved reserved reserved comp_stat[0 ] config0 2004 vref_cal pls_inv ckout_e[1:0] vref_dis mpu_div[2:0] config1 2005 reserved reserved eck_dis fir_len adc_e mux_alt flsh66z reserved version 2006 version[7:0] config2 2007 opt_txe[1:0] ex_pll ex_fwcol reserved opt_fdc[1:0] ce3 20a8 not used not used not used ce_lctn[4:0] wake 20a9 wake_arm sleep lcd_only not used wake_res wake_prd[2:0] tmux 20aa not used not used not used tmux[4:0] digital i/o: dio0 2008 dio_eex[1:0] opt_rxdis opt_rxinv dio_pw dio_pv opt_txmod opt_txinv dio1 2009 not used dio_r1[2:0] not used di_rpb[2:0] dio2 200a not used reserved not used dio_r2[2:0] dio3 200b not used dio_r5[2:0] not used dio_r4[2:0] dio4 200c not used dio_r7[2:0] not used dio_r6[2:0] dio5 200d not used dio_r9[2:0] not used dio_r8[2:0] dio6 200e not used dio_r11[2:0] not used dio_r10[2:0] real time clock: rtc0 2015 not used not used rtc_sec[5:0] rtc1 2016 not used not used rtc_min[5:0] rtc2 2017 not used not used not used rtc_hr[4:0] rtc3 2018 not used not used not used not used not used rtc_day[2:0] rtc4 2019 not used not used not used rtc_date[2:0] rtc5 201a not used not used not used not used rtc_mo[3:0] rtc6 201b rtc_yr[7:0] rtc7 201c not used not used not used not used not used not used rtc_dec_sec rtc_inc_sec we 201f write enable for rtc lcd display interface: lcdx 2020 not used bme reserved lcd_num[4:0] lcdy 2021 not used lcd_y lcd_e lcd_mode[2:0] lcd_clk[1:0] lcdz 2022 not used not used not used reserved lcd0 2030 not used lcd_seg0[3:0] ? ? not used ? lcd19 2043 not used lcd_seg19[3:0] lcd24 2048 not used lcd_seg24[3:0] ? ? not used ? lcd38 2056 not used lcd_seg38[3:0] lcd_bln k 205a lcd_blkmap19[3:0] lcd_blkmap18[3:0]
71m6521de/dh/fe data sheet page: 74 of 107 re v 2 rtm probes: rtm0 2060 rtm0[7:0] rtm1 2061 rtm1[7:0] rtm2 2062 rtm2[7:0] rtm3 2063 rtm3[7:0] pulse generator: pls_w 2080 pls_maxwidth[7:0] pls_i 2081 pls_interval[7:0] sfr map (sfrs specific to the teridian 80515) ? in numerical order ?not used? bits are blacked out and contain no memory and are read by the mpu as zero. reserved bits are in use and should not be changed. this table lists only the sfr registers that are not generic 8051 sfr regis ters name sfr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 digital i/o: dio7 80 dio_0[7:4] (port 0) reserved dio_0[2:1] pb dio8 a2 dio_dir0[7:4] reserved dio_dir0[2:1] reserved dio9 90 dio_1[7:6] reserved dio_1[3:0] (port 1) dio10 91 dio_dir1[7:6] reserved dio_dir1[3:0] dio11 a0 not used not used dio2[5:3] (qfn - 68) * reserved dio_2[1:0] (port 2) dio12 a1 not used not used dio_dir2[5:3] (qfn - 68) * reserved dio_dir2[1:0] interrupts and wd timer: intbits f8 int6 int5 int4 int3 int2 int1 int0 iflags e8 ie_pllfall wd_rst ie_pllrise ie_wake ie_pb ie_fwcol1 ie_fwcol0 ie_rtc ie_xfer flash: erase 94 flsh_erase[7:0] flshctl b2 preboot secure not used not used not used not used flsh_meen flsh_pwe pgadr b7 flsh_pgadr[6:0] not used serial eeprom: eedata 9e eedata[7:0] eectrl 9f eectrl[7:0] * = only available on qfn - 68 package. reserved in lqfp - 64 package.
71m6521de/dh/fe data sheet re v 2 page: 75 of 107 i/o ram description ? alphabetical order bits with a w (write) direction are written by the mpu into configuration ram. typically, they are initially stored in flash memory and copied to the configuration ram by the mpu. some of the more frequently programmed bits are mapped to the mpu sfr memory space. the r emaining bits are mapped to the address range 0x2xxx. bits with r (read) direction can be read by the mpu. columns labeled ? rst ? and ? wk ? describe the bit values upon reset and wake, respectively. no entry in one of these columns means the bit is either re ad- only or is powered by the non - volatile supply and is not initialized. write - only bits will return zero when they are read. name location rst wk dir description adc_e 2005[3] 0 0 r/w enables adc and vref. when disabled, removes bias current bme 2020[6] 0 - r/w battery measure enable. when set, a load current is immediately applied to the battery and it is connected to the adc to be measured on alternative mux cycles. see mux_alt bit. ce_e 2000[4] 0 0 r/w ce enable. ce_lctn[4:0] 20a8[4:0] 31 31 r/w ce program location. the starting address for the ce program is 1024* ce_lctn . ce_lctn must be defined before the ce is en - abled. chop_e[1:0] 2002[5:4] 0 0 r/w chop enable for the reference bandgap circuit. the value of chop will change on the rising edge of muxsync according to the value in chop_e : 00- toggle 1 01- positive 10- reversed 11- toggle 1 except at the mux sync edge at the end of sumcycle. ckout_e[1:0] 2004[5,4] 00 00 r/w cktest enable. the default is 00 00- seg19, 01- ck_fir (5mhz mission, 32khz brownout) 10- not allowed (reserved for production test) 11 - same as 10. comp_stat[0] 2003[0] -- -- r the status of the power fail comparator for v1. di_rpb[2:0] dio_r1[2:0] dio_r2[2:0] dio_r4[2:0] dio_r5[2:0] dio_r6[2:0] dio_r7[2:0] dio_r8[2:0] dio_r9[2:0] dio_r10[2:0] dio_r11[2:0] 2009[2:0] 2009[6:4] 200a[2:0] 200b[2:0] 200b[6:4] 200c[2:0] 200c[6:4] 200d[2:0] 200d[6:4] 200e[2:0] 200e[6:4] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 r/w connects dedicated i/o pins dio2 and dio4 through dio11 as well as input pins pb and dio1 to internal resources. if more than o ne input is connected to the same resource, the ?multiple? column below specifies how they are combined. dio_rx resource multiple 000 none -- 001 reserved or 010 t0 (timer0 clock or gate) or 011 t1 (timer1 clock or gate) or 100 high priority io interrupt (int0 rising) or 101 low priority io interrupt (int1 rising) or 110 high priority io interrupt (int0 falling) or 111 low priority io interrupt (int1 falling) or dio_dir0[7:4,2:1] sfra2 [7:4,2:0] 0 0 r/w programs the direction of pins dio7 - dio4 and dio2- dio1. 1 in di - cates output. ignored if the pin is not configured as i/o. see dio_pv and dio_pw for special option for dio6 and dio7 outputs. see dio_eex for special option for dio4 and dio5.
71m6521de/dh/fe data sheet page: 76 of 107 re v 2 dio_dir1[7:6, 3:0] sfr91 [7:6,3:0] 0 0 r/w programs the direction of pins dio15 - dio14, dio11 - dio8. 1 indi - cates output. ignored if the pin is not configured as i/o. dio_dir2 [5:3,2:1] sfra1 [5:3,2:1] 0 0 r/w programs the direction of pins dio17 - dio16 (and dio19 - dio21 for the qfn package). 1 indicates output. ignored if the pin is not con - figured as i/o. dio_0[7:4,2:0] sfr80 [7:4,2:0] 0 0 r/w the value on the pins dio7 - dio4 and dio2 - dio1. pins configured as lcd will read zero. when written, changes data on pins con fi - gured as outputs. pins configured as lcd or input will ignore write operations. the pushbutton input pb is read on dio_0[0]. dio_1[7:6,3:0] sfr90 [7:6,3:0] 0 0 r/w the value on the pins dio15 - dio14 and dio11 - dio8. pins con - figured as lcd will read zero. when written, changes data on pins con fi gured as outputs. pins configured as lcd or input will ignore write operations . dio_2[5:3,1:0] sfra0 [5:3,1:0] 0 0 r/w the value on the pins dio17 - dio16 (and dio19 - dio21 for the qfn package). pins configured as lcd will read zero. when written, changes data on pins con fi gured as out puts. pins configured as lcd or input will ignore write operations. dio_eex[1:0] 2008[7:6] 0 0 r/w when set, converts dio4 and dio5 to interface with external eeprom. dio4 becomes sdck and dio5 becomes bi - directional sdata. lcd_num must be less than or equal to 18. dio_eex[1:0] function 00 disable eeprom interface 01 2 - wire eeprom interface 10 3 - wire eeprom interface 11 -- not used -- dio_pv 2008[2] 0 0 r/w causes varpulse to be output on dio7, if dio7 is configured as output. lcd_num must be less than 15. dio_pw 2008[3] 0 0 r/w causes wpulse to be output on dio6, if dio6 is configured as output. lcd_num must be less than 16. eedata[7:0] sfr9e 0 0 r/w serial eeprom interface data eectrl[7:0] sfr9f 0 0 r/w serial eeprom interface control eck_dis 2005[5] 0 0 r/w emulator clock disable. when one, the emulator clock is disabled. this bit is to be used with caution! inadvertently setting this bit will inhibit access to the part with the ice interface and thus preclude flash erase and pro - gramming operations . if eck_ena is set, it should be done at least 1000ms after power - up to give emulators and programming devices enough time to complete an erase op e ration. equ[2:0] 2000[7:5] 0 0 r/w specifies the power equation to be used by the ce. ex_xfr ex_rtc ex_fwcol ex_pll 2002[0] 2002[1] 2007[4] 2007[5] 0 0 0 0 0 0 0 0 r/w interrupt enable bits. these bits enable the xfer_busy, the rtc_1sec, the firmwarecollision, and pll interrupts. note that if one of these interrupts is to be enabled, its corresponding ex enable bit must also be set. see the interrupts section for details . fir_len 2005[4] 0 0 r/w the length of the adc decimation fir filter. 1 - 384 cycles, 0 - 288 cycles when fir_len =1, the adc has 2.370370x higher gain.
71m6521de/dh/fe data sheet re v 2 page: 77 of 107 flsh_erase[7:0] sfr94[7:0] 0 0 w flash erase initiate flsh_erase is used to initiate either the flash mass erase cycle or the flash page erase cycle. specific patterns are expected for flsh_erase in order to initiate the appropriate erase cycle. (default = 0x00). 0x55 ? initiate flash page erase cycle. must be proceeded by a write to flsh_pgadr @ sfr 0xb7. 0xaa ? initiate flash mass erase cycle. must be proceeded by a write to flsh_meen @ sfr 0xb2 and the debug (cc) port must be enabled. any other pattern written to flsh_erase will have no effect. flsh_meen sfrb2[1] 0 0 w mass erase enable 0 ? mass erase disabled (default). 1 ? mass erase enabled. must be re - written for each new mass erase cycle. flsh_pgadr[6:0] sfrb7[7:1] 0 0 w flash page erase address flsh_pgadr[6:0] ? flash page address (page 0 thru 127) that will be erased during the page erase cycle. (default = 0x00). must be re - written for each new page erase cycle. flsh_pwe sfrb2[0] 0 0 r/w program write enable 0 ? movx commands refer to xram space, normal operation (default). 1 ? movx @dptr,a moves a to program space (flash) @ dptr. this bit is automatically reset after each byte written to flash. writes to this bit are inhibited when interrupts are enabled. fovride 20fd[4] 0 0 r/w permits the values written by mpu to temporarily override the values in the fuse register (reserved for production test). ie_fwcol0 ie_fwcol1 sfre8[2] sfre8[3] 0 0 0 0 r/w r/w interrupt flags for firmware collision interrupt. see flash memory section for details. ie_pb sfre8[4] 0 -- r/w pb flag. indicates that a rising edge occurred on pb. firmware must write a zero to this bit to clear it. the bit is also cleared when mpu re quests sleep or lcd mode. on bootup, the mpu can read this bit to determine if the part was woken with the pb dio0[0]. ie_pllrise sfre8[6] 0 0 r/w indicates that the mpu was woken or interrupted (int 4) by system power becoming available, or more precisely, by pll_ok rising. firmware must write a zero to this bit to clear it ie_pllfall sfre8[7] 0 0 r/w indicates that the mpu has entered brownout mode because system power has become unavailable (int 4), or more precisely, because pll_ok fe ll. note: this bit will not be set if the part wakes into brownout mode because of pb or the wake timer. firmware must write a zero to this bit to clear it. ie_xfer ie_rtc sfre8[0] sfre8[1] 0 0 0 0 r/w interrupt flags. these flags monitor the xfer_busy interrupt and the rtc_1sec interrupt. the flags are set by hardware and must be cleared by the interrupt handler. note that ie6, the interrupt 6 flag bit in the mpu must also be cleared when either of these interrupts occur. ie_wake sfre8[5] 0 -- r/w indicates that the mpu was woken by the autowake timer. this bit is typically read by the mpu on bootup. firmware must write a zero to this bit to clear it intbits sfrf8[6:0] -- -- r/w interrupt inputs. the mpu may read these bits to see the input to external interrupts int0, int1, up to int6. these bits do not have any memory and are primarily intended for debug use. lcd_blkmap19[3:0 ] lcd_blkmap18[3:0] 205a[7:4] 205a[3:0] 0 -- r/w identifies which segments connected to seg18 and seg19 should blink. 1 means ?blink.? most significant bit corresponds to com3. least significant, to com0. lcd_clk[1:0] 2021[1:0] 0 -- r/w sets the lcd clock frequency (for com/seg pins, not frame rate). note: f w = 32768hz 00: f w /2 9 , 01: f w/ 2 8 , 10: f w /2 7 , 11: f w /2 6
71m6521de/dh/fe data sheet page: 78 of 107 re v 2 lcd_e 2021[5] 0 -- r/w enables the lcd display. when disabled, vlc2, vlc1, and vlc0 are ground as are the com and seg outputs. lcd_mode[2:0] 2021[4:2] 0 -- r/w the lcd bias mode. 000: 4 states, 1/3 bias 001: 3 states, 1/3 bias 010: 2 states, ? bias 011: 3 states, ? bias 100: static display lcd_num[4:0] 2020[4:0] 0 -- r/w number of dual - purpose lcd/dio pins to be configured as lcd. this will be a number between 0 and 18. the first dual - purpose pin to be allocated as lcd is seg41/dio21. thus if lcd_num =2, seg41 and seg 40 will be configured as lcd. the remaining seg39 to se g24 will be configured as dio19 to dio4. dio1 and dio2 (plus dio3 on the qfn - 68 package) are always available, if not used for the optical port. see tables in application section. lcd_only 20a9[5] 0 0 w takes the 6521fe/de to lcd mode. ignored if system power is present. the part will awaken when autowake timer times out, when push button is pushed, or when system power returns. lcd_seg0[3:0] ? lcd_seg19[3:0] 2030[3:0] ? 2043[3:0] 0 ? 0 -- ? -- r/w lcd segment data. each word contains information for from 1 to 4 time divisions of each segment. in each word, bit 0 corresponds to com0, on up to bit 3 for com3. these bits are preserved in lcd and sleep modes, even if their pin is not configured as seg. in this case, they can be useful as general - purpos e non - volatile storage. lcd_seg24[3:0] ? lcd_seg38[3:0] 2048[3:0] ? 2056[3:0] 0 ? 0 -- ? -- r/w lcd_y 2021[6] 0 0 r/w lcd blink frequency (ignored if blink is disabled or if segment is off). 0: 1hz (500ms on, 500ms off) 1: 0.5hz (1s on, 1s off) mpu_div[2:0] 2004[2:0] 0 0 r/w the mpu clock divider (from 4.9152mhz). these bits may be pro - grammed by the mpu without risk of losing control. 000- 4.9152mhz, 001- 4.9152mhz /2 1 , ?, 111 - 4.9152mhz /2 7 mpu_div remains unchanged when the part enters brownout mode. mux_alt 2005[2] 0 0 r/w the mpu asserts this bit when it wishes the mux to perform adc conversions on an alternate set of inputs.
71m6521de/dh/fe data sheet re v 2 page: 7 9 of 107 mux_div[1:0] 2002[7:6] 0 0 r/w the number of states in the input multiplexer. 00- illegal 01 - 4 states 10 - 3 states 11 - 2 states opt_fdc[1:0] 2007[1:0] 0 0 r/w selects opt_tx modulation duty cycle opt_fdc function 00 50% low 01 25% low 10 12.5% low 11 6.25% low opt_rxdis 2008[5] 0 0 r/w opt_rx can be configured as an analog input to the optical uart comparator or as a digital input/output, dio1. 0 ? opt_rx, 1 ? dio1. opt_rxinv 2008[4] 0 0 r/w inverts result from opt_rx comparator when 1. affects only the uart input. has no effect when opt_rx is used as a dio input. opt_txe[1,0] 2007[7,6] 00 00 r/w configures the opt_tx output pin. 00 ? opt_tx, 01 ? dio2, 10 ? wpulse, 11 ? varpulse opt_txinv 2008[0] 0 0 r/w invert opt_tx when 1. this inversion occurs before modulation. opt_txmod 2008[1] 0 0 r/w enables modulation of opt_tx. when opt_txmod is set, opt_tx is modulated when it would otherwise have been zero. the modulation is applied after any inversion caused by opt_txinv . pll_ok 2003[6] 0 0 r indicates that system power is present and the clock generation pll is settled. pls_maxwidt h [7:0] 2080[7:0] ff ff r/w determines the maximum width of the pulse (low going pulse). maximum pulse width is (2*pls_maxwidth + 1)*t i . where t i is pls_interval. if pls_interval=0, t i is the sample time (397s). if 255, disable maxwidth . pls_interval [7:0] 2081[7:0] 0 0 r/w if the fifo is used, pls_interval must be set to 81. if pls_interval = 0, the fifo is not used and pulses are output as soon as the ce issues them. pls_inv 2004[6] 0 0 r/w inverts the polarity of wpulse and varpulse. normally, these pulses are active low. when inverted, they become active high. preboot sfrb2[7] -- -- r indicates that preboot sequence is active. pre_samps[1:0] 2001[7:6] 0 0 r/w the duration of the pre - summer, in samples. 00 - 42, 01 - 50, 10 - 84, 11 - 100. rtc_sec[5:0] rtc_min[5:0] rtc_hr[4:0] rtc_day[2:0] rtc_date[4:0] rtc_mo[3:0] rtc_yr[7:0] 2015 2016 2017 2018 2019 201a 201b -- -- -- -- -- -- -- -- -- -- -- -- -- -- r/w r/w r/w r/w r/w r/w r/w the rtc interface. these are the ?year?, ?month?, ?day?, ?hour?, ?minute? and ?second? parameters of the rtc. the rtc is set by writing to these registers. year 00 and all others divisible by 4 are defined as leap years. sec 00 to 59 min 00 to 59 hr 00 to 23 (00=midnight) day 01 to 07 (01=sunday) date 01 to 31 mo 01 to 12 yr 00 to 99 each write to one of these registers must be preceded by a write to 201f (we).
71m6521de/dh/fe data sheet page: 80 of 107 re v 2 rtc_dec_sec rtc_inc_sec 201c[1] 201c[0] 0 0 0 0 w rtc time correction bits. only one bit may be pulsed at a time. when pulsed, causes the rtc time value to be incremented (or decremented) by an additional second the next time the rtc_sec register is clocked. the pulse width may be any value. if an additional correction is desired, the mpu m ust wait 2 seconds before pulsing one of the bits again. each write to one of these bits must be preceded by a write to 201f (we). rtm_e 2002[3] 0 0 r/w real time monitor enable. when ?0?, the rtm output is low. this bit enables the two wire version of rtm rtm0[7:0] rtm1[7:0] rtm2[7:0] rtm3[7:0] 2060 2061 2062 2063 0 0 0 0 0 0 0 0 r/w four rtm probes. before each ce code pass, the values of these registers are serially output on the rtm pin. the rtm registers are ignored when rtm_e =0. secure sfrb2[6] 0 -- r/w enables security provisions that prevent external reading of flash memory and ce program ram. this bit is reset on chip reset and may only be set. attempts to write zero are ignored. sleep 20a9[6] 0 0 w takes the 6521de/dh/fe to sleep mode. ignored if system power is present. the part will wake when the autowake timer times out, when push button is pushed, or when system power returns. sum_cycles[5:0 ] 2001[5:0] 0 0 r/w the number of pre - summer outputs summed in the final summer. tmux[4:0] 20aa[4:0] 2 -- r/w selects one of 32 signals for tmuxout. [4:0] selected signal [4:0] selected signal 0x00 dgnd (analog) 0x01 reserved 0x02 reserved 0x03 reserved 0x04 reserved 0x05 reserved 0x06 vbias (analog) 0x07 not used 0x08 reserved 0x09 reserved 0x0a reserved 0x0b - 0x13 reserved 0x14 rtm (real time out put from ce) 0x15 wdtr_e, com parator 1 output and v1lt3) 0x16 ? 0x17 not used 0x18 rxd, from optical in - terface, after optional in ver sion 0x19 mux_sync 0x1a ck_10m 0x1b ck_mpu 0x1c reserved 0x1d rtclk_2p5 0x1e ce_busy 0x1f xfer_busy trim[7:0] 20ff 0 0 r/w contains tri m t[7 :0] , trimbga , trimbgb or trimm[2:0] depending on the value written to trimsel[3:0] . if trimbgb = 0, the device is a 71m 6521de/fe , else it is a 71m6521dh . trimsel[3:0] 20fd[3:0] 0 0 r/w selects the temperature trim fuse to be read with the trim register: trimsel[3:0] trim fuse purpo se 1 tri m t[7 :0] trim for the magnitude of vref 4 trimm[2:0] trim values related to temperature compensation 5 trimbga 6 trimbgb
71m6521de/dh/fe data sheet re v 2 page: 81 of 107 version[7:0] 2006 -- -- r the version index. this word may be read by firmware to determine the silicon version. version[7:0] silicon version 0000 0110 a06 vref_cal 2004[7] 0 0 r/w brings vref to vref pad. this feature is disabled when vref_dis =1. vref_dis 2004[3] 0 1 r/w disables the internal voltage reference. wake_arm 20a9[7] 0 -- w arm the autowake timer. writing a 1 to this bit arms the autowake timer and presets it with the values presently in wake_prd and wake_res . the autowake timer is reset and disarmed whenever the mpu is in mission mode or brownout mode. the timer must be arme d at least three rtc cycles before the sleep or lcd - only mode is commanded. wake_prd 20a9[2:0] 001 -- r/w sleep time. time= wake_prd[2:0]*wake_res. default=001. maximum value is 7. wake_res 20a9[3] 0 -- r/w resolution of wake timer: 1 ? 1 minute, 0 ? 2.5 seconds. wd_rst sfre8[7] 0 0 w wd timer bit: possible operations to this bit are: read: gets the status of the flag ie_pllfall write 0: clears the flag write 1:.resets the wdt wd_ovf 2002[2] 0 0 r/w the wd overflow status bit. this bit is set when the wd timer overflows. it is powered by the non - volatile supply and at bootup will indicate if the part is recovering from a wd overflow or a power fault. this bit should be cleared by the mpu on bootup. it is also automatically cleared when reset is high. we 201f7:0] -- -- w write operations on the rtc registers must be preceded by a write operation to we .
71m6521de/dh/fe data sheet page: 82 of 107 re v 2 ce interface description ce program the ce program is supplied as a data image that can be merged with the mpu operational code for meter applications. typically, the ce program covers most applications and does not need to be modified. for equ = 0 and equ = 1, ce code ce21a04_2 should be used. for equ = 2, ce code image ce21a03_2 should be used. the description in this section applies to ce code revision ce21a03_2. formats all ce words are 4 bytes. unless specified otherwise, they are in 32 - bit two?s complement ( - 1 = 0xffffffff). ?calibration? para meters are defined in flash memory (or external eeprom) and must be copied to ce data memory by the mpu before enabling the ce. ?internal? variables are used in internal ce calculations. ?input? variables allow the mpu to control the be havior of the ce code. ?output? variables are outputs of the ce calculations. the corresponding mpu address for the most signi ficant byte is given by 0x1000 + 4 x ce_address and 0x1003 + 4 x ce_address for the least significant byte. constants constants u sed in the ce data memory tables are: ? f s = 32768hz/13 = 2520.62hz. ? f 0 is the fundamental frequency. ? imax is the external rms current corresponding to 250mv pk at the inputs ia and ib. ? vmax is the external rms voltage corresponding to 250mv pk at the va an d vb inputs. ? n acc , the accumulation count for energy measurements is pre_samps*sum_cycles . ? accumulation count time for energy measurements is pre_samps*sum_cycles /f s . the system constants imax and vmax are used by the mpu to convert internal quantities (as used by the ce) to ex - ternal, i.e. metering quantities. their values are determined by the off - chip scaling of the voltage and current sensors used in an actual meter. the lsb values used in this document relate digital quantities at the ce or mpu interfa ce to external meter input quantities. for exam ple, if a sag threshold of 80v peak is desired at the meter input, the digital value that should be pro grammed into sag_thr would be 80v/ sag_thr lsb , where sag_thr lsb is the lsb value in the description of sa g_thr . the parameters equ , ce_e , pre_samps, and sum_cycles essential to the function of the ce are stored in i/o ram (see i/o ram section). environment before starting the ce using the ce_e bit, the mpu has to establish the proper environment for the ce by implementing the following steps: ? load the ce data into ce dram. ? establish the equation to be applied in equ. ? establish the accumulation period and number of samples in pre_samps and sum_ cycles . ? establish the number of cycles per adc mux frame. ? set pls_interval [7:0] to 81. ? set fir_len to 1 and mux_div to 1. there must be thirteen 32768hz cycles per adc mux frame (see system timing diagram, figure 16 ). this means that the product of the number of cycles per frame and the number of conversions per frame must be 12 (allowing for one settling cycle). the required configuration is fir_len = 1 (three cycles per conversion) and mux_div = 1 (4 conversions per mux frame).
71m6521de/dh/fe data sheet re v 2 page: 83 of 107 during operation, the mpu is in charge of controlling the multiplexer cycles, for example by inserting an alternate multiplexer sequence at regular intervals using mux_alt . this enables temperature measurement. the polarity of chopping circuitry must be altered for each sample. it must also alternate for each alternate multiplexer reading. this is accomplished by maintaining chop_e = 00. ce calculations the ce performs the precision computations necessary to accurately measure energy. these computations in clude offset cancellation, products, product smoothing, product summation, frequency detection, var calculation, sag detection, peak detection, and voltage phase measureme nt. all data computed by the ce is dependent on the selected meter equation as given by equ ( in i/o ram ) . although equ =0 and equ =2 have the same element mapping, the mpu code can use the value of equ to decide if element 2 is used for tamper detection (typ ically done by connecting vb to va) or as a second independent element. equ watt & var formula (wsum/varsum) element input mapping w0sum/ var0sum w1sum/ var1sum i0sqsum i1sqsum 0 va ia (1 element, 2w 1 ) with tamper detection va*ia va*ib ia ib 1 va*(ia - ib)/2 (1 element, 3w 1 ) va*(ia - ib)/2 va*ib/2 ia -ib ib 2 va*ia + vb*ib (2 element, 4w 2 ) va*ia vb*ib ia ib ce status since the ce_busy interrupt occurs at 2520.6hz, it is desirable to minimize the computation required in the interrupt handler of the mpu. the mpu can read the ce status word at every ce_busy interrupt. ce address name description 0x7a cestatus see description of ce status word below the ce status word is used for generating early warnings to the mpu. it contains sag warnings for va as well as f0, the derived clock operating at the fundamental input frequency. cestatus provides information about the status of voltage and input ac signa l frequency, which are useful for generating early power fail warnings, e.g. to initiate necessary data storage. cestatus represents the status flags for the preceding ce code pass (ce busy interrupt). sag alarms are not remembered from one code pass to th e next. the ce status word is refreshed at every ce_busy interrupt.
71m6521de/dh/fe data sheet page: 84 of 107 re v 2 the significance of the bits in cestatus is shown in the table below: cestatus [bit] name description 31-29 not used these unused bits will always be zero. 28 f0 f0 is a square wave at the exact fundamental input frequency. 27 reserved 26 sag_b normally zero. becomes one when vb remains below sag_thr for sag_cnt samples. will not return to zero until vb rises above sag_thr . 25 sag_a normally zero. becomes one whe n va remains below sag_thr for sag_cnt samples. will not return to zero until va rises above sag_thr . 24-0 not used these unused bits will always be zero. the ce is initialized by the mpu using ceconfig ( cestate. ). this register contains in packed form sag_cnt, freqsel , ext_pulse , i0_shunt , i1_shunt , pulse_slow , and pulse_fast . ce address name default description 0x10 ceconfig 0x5020 see description of ceconfig below the significance of the bits in ceconfig is shown in the table below: ia_shunt and/or ib_shunt can configure their respective current inputs to accept shunt resistor sensors. in this case the ce provides an additional gain of 8 to the selected current input. wrate may need to be adjusted based on the values of ia_ shunt and ib_ shunt . whenever ia_shunt or ib_shunt are set to 1, in_8 (in the equation for kh) is assigned a value of 8. the ce pulse generator can be controlled by either the mpu (external) or ce (internal) variables. control is by the mpu if ext_pulse = 1. in this case, the mpu controls the pulse rate by placing values into apulsew and apulser . by setting ext_pulse = 0, the ce controls the pulse rate based on w0sum_x + w1sum_x (and var0sum_x + var1sum_x ). if ext_pulse is 1, and if equ = 2, the pulse inputs are w0sum_x+w1sum _x and var0sum_x+var1sum_x . in this case, creep cannot be controlled since creep is an mpu function. if ext_pulse = 1 and equ = 0, the pulse inputs are w0sum_x if i0sqsum_x > i1sqsum_x , and w1sum_x , if i1sqsum_x > i0sqsum_x . note: the 6521 demo code creep function halts both internal and external pulse generation.
71m6521de/dh/fe data sheet re v 2 page: 85 of 107 ceconfig [bit] name default description [15:8] sag_cnt 80 (0x50) number of consecutive voltage samples below sag_thr before a sag alarm is declared. the maximum value is 255. sag_thr is at address 0x14. [7] -- 0 unused [6] freqsel 0 selected phase for frequency monitor (0 = a, 1 = b). [5] ext_pulse 1 when zero, causes the pulse generators to respond to wsum_x and varsum_x . otherwise, the generators respond to values the mpu places in apulsew and apulser . [4] -- 0 unused [3] ib_shunt 0 when 1, the current gain of channel b is increased by 8. the gain factor controlled by in_shunt is referred to as in_8 throughout this document. [2] ia_shunt 0 when 1, the current gain of channel a is increased by 8. [1] pulse_fast 0 when pulse_slow = 1, the pulse generator input is reduced by a factor of 64. when pulse_fast = 1, the pulse generator input is increased 16x. these two parameters control the pulse gain factor x (see table below). allowed values are either 1 or 0. default is 0 (x = 6). x pulse_slow pulse_fast 1.5 * 2 2 = 6 0 0 1.5 * 2 6 = 96 0 1 1.5 * 2 - 4 = 0.09375 1 0 1.5 1 1 [0] pulse_slow 0 ce transfer variables when the mpu receives the xfer_busy interrupt, it knows that fresh data is available in the transfer variables. the transfer variables can be categorized as: 1. fundamental energy measurement variables 2. instantaneous (rms) values 3. other measurement parameters 4. pulse generation variables 5. current shunt variables 6. calibration parameters
71m6521de/dh/fe data sheet page: 86 of 107 re v 2 fundamental energy measurement variables the table below describes each transfer variable for fundamental energy mea surement. all variables are signed 32 bit integers. accumulated variables such as wsum are internally scaled so they have at least 2x margin before overflow when the integration time is 1 second. additionally, the hardware will not permit output values to ?fold back? upon overflow. ce address name description 0x76 w0sum_x the sum of watt samples from each wattmeter element ( in_8 is the gain configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 wh. 0x72 w1sum_x 0x75 var0sum_x the sum of var samples from each wattmeter element ( in_8 is the gain configured by ia_shunt or ib_shunt ). lsb = 6.6952*10 - 13 vmax imax / in_8 wh. 0x71 var1sum_x wxsum_x is the wh value accumulated for element ?x? in the last accumulation interval and can be computed based on the specified lsb value. for example with vmax = 600v and imax = 208a, lsb (for wxsum_x ) is 0.08356 wh. instantaneous energy measurement variable s the frequency measurement is computed using the frequency locked loop for the selected phase. ixsqsum_x and vxsqsum are the squared current and voltage samples acquired during the last accumulation interval. insqsum_x can be used for computing the neutr al current. ce address name description 0x79 freq_x fundamental frequency. lsb 6 32 10 587 . 0 2 ? ? s f hz 0x77 i0sqsum_x the sum of squared current samples from each element. lsb = 6.6952*10 - 13 imax 2 / in_8 2 a 2 h 0x73 i1sqsum_x 0x78 v0sqsum_x the sum of squared voltage samples from each element. lsb= 6.6952*10 - 13 vmax 2 v 2 h 0x74 v1sqsum_x 0x7d wsum_accum these are roll - over accumulators for wpulse and vpulse respectively. 0x7e vsum_accum the rms values can be computed by the mpu from the squared current and voltage samples as follows: acc s rms n f lsb ixsqsum ix ? ? ? = 3600 other measurement parameters mainedge_x is useful for implementing a real - time clock based on the input ac signal. mainedge_x is the number of half - cycles accounted for in the last accumulated interval for the ac signal. temp_raw may be used by the mpu to monitor chip temperature or to implement temperature compensation. acc s rms n f lsb vxsqsum vx ? ? ? = 3600
71m6521de/dh/fe data sheet re v 2 page: 87 of 107 ce address name default description 0x7c mainedge_x n/a the number of zero crossings of the selected voltage in the pre vious ac - cumulation interval. zero crossings are either direction and are de bounced. 0x7b temp_raw_x n/a filtered, unscaled reading from the temperature sensor. 0x12 gain_adj 16384 scales all voltage and current inputs. 16384 provides unity gain. 0x14 sag_thr 443000 the threshold for sag warnings. the default value is equivalent to 80v rms if vmax = 600v. the lsb value is vmax * 4.255*10 - 7 v (peak). gain_adj is a scaling factor for measurements based on the temperature. gain_adj is controlled by the mpu for temperature compensation. pulse generation ce address name default description 0x11 wrate 122 kh = vmax * imax *47.1132 / (in_8* wrate *n acc *x) wh/pulse. the default value results in a kh of 3.2wh/pulse when 2520 samples are taken in each accumulation interval (and vmax=600, imax = 208, in_8 = 1, x = 6). the maximum value for wrate is 2 15 ? 1. 0x0e apulsew 0 watt pulse generator input (see dio_pw bit). the output pulse rate is: apulsew * f s * 2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loaded during a computation interval. the change will take effect at the beginning of the next interval. 0x0f apulser 0 var pulse generator input (s ee dio_pv bit). the output pulse rate is: apulser * f s *2 - 32 * wrate * x * 2 - 14 . this input is buffered and can be loaded during a computation interval. the change will take effect at the beginning of the next interval. wrate controls the number of pulses that are generated per measured wh and varh quantities. the lower wrate is the slower the pulse rate for measured energy quantity. the metering constant kh is derived from wrate as the amount of energy measured for each pulse. that is, if kh = 1wh/pulse, a power applied to the meter of 120v and 30a results in one pulse per second. if the load is 240v at 150a, ten pulses per second will be generated. the maximum pulse rate is 7.5khz. the maximum time jitter is 67s and is independent of the number of pulses measured. thus, if the pulse generator is monitored for 1 second, the peak jitter is 67ppm. after 10 seconds, the peak jitter is 6.7ppm. the average jitter is always zero. if it is attempted to drive either pulse generator faster than its maximum rate, it will simply output at its maximum rate without exhibiting any rollover characteristics. the actual pulse rate, using wsum as an example, is: hz x f wsum wrate rate s 46 2 ? ? ? = , where f s = sampl ing frequency (2520.6hz), x = pulse speed factor
71m6521de/dh/fe data sheet page: 88 of 107 re v 2 ce calibration parameters the table below lists the parameters that are typically entered to effect calibration of meter accuracy. ce address name default description 0x08 cal_ia 16384 these constants control the gain of their respective channels. the nominal value for each parameters is 2 14 = 16384. the gain of each channel is directly proportional to its cal parameter. thus, if the gain of a channel is 1% slow, cal should be scaled by 1/(1 ? 0.01). 0 x09 cal_va 16384 0x0a cal_ib 16384 0x0b cal_vb 16384 0x0c phadj_a 0 these two constants control the ct phase compensation. no com pensation occurs when phadj_x = 0. as phadj_x is increased, more compensation (lag) is introduced. range: 2 15 ? 1. if it is desired to delay the current by the angle : ? ? ? = tan tan x phadj 0131 . 0 1487 . 0 02229 . 0 2 _ 20 at 60hz ? ? ? = tan tan x phadj 009695 . 0 1241 . 0 0155 . 0 2 _ 20 at 50hz 0x0d phadj_b 0 other ce parameters the table below shows ce parameters used for suppression of noise due to scaling and truncation effects. ce address name default description 0x13 quanta 0 this parameter is added to the watt calculation for element 0 to compensate for in put noise and truncation. lsb = ( vmax * imax / in_8 ) *7.4162*10 - 10 w 0x18 quantb 0 this parameter is added to the watt calculation for element 1 to compensate for in put noise and truncation. same lsb as quanta. 0x15 quant_vara 0 this parameter is added to the var calculation for element a to compensate for in put noise and truncation. lsb = ( vmax * imax / in_8 ) * 7. 4162*10 - 10 w 0x1b quant_varb 0 this parameter is added to the var calculation for element b to compensate for in put noise and truncation. same lsb as for quant_vara. 0x16 quant_i 0 this parameter is added to compensate for input noise and truncation in the squaring calculations for i 2 . quant_i affects only i0sqsum and i1sqsum . lsb = ( imax 2 /in_8 2 )*7.4162*10 - 10 a 2
71m6521de/dh/fe data sheet re v 2 page: 89 of 107 electrical specifica tions absolute maximum ratings supplies and ground pins: v3p3sys, v3p3a ? 0. 5 v to 4. 6 v vbat - 0. 5 v to 4. 6 v gndd - 0. 5 v to +0. 5 v analog output pins: v3p3d - 1 0 ma to 1 0 ma , - 0. 5 v to 4. 6 v vref - 1 0 ma to +1 0 ma , - 0. 5 v to v3p3a+0. 5 v v2p5 - 1 0 ma to +1 0 ma , - 0. 5 v to 3.0v analog input pins: ia, va, ib, vb, v1 - 1 0 ma to +1 0 ma - 0. 5 v to v3p3a+0. 5 v xin, xout - 1 0 ma to +1 0 ma - 0. 5 v to 3.0v all other pins: configured as seg or com drivers - 1 ma 1 ma to + 1 ma 1 ma, - 0.5 to v3p3d+0.5 configured as digital inputs - 1 0 ma to +1 0 ma , - 0.5 to 6 v configured as digital outputs - 1 5 ma to +1 5 ma , - 0. 5 v to v3p3d+0. 5 v all other pins ? 0. 5 v to v3p3d+0. 5 v operating junction temperature (peak, 100ms) 140 c operating junction temperature (continuous) 125 c storage temperature ? 45 c to +165 c solder temperature ? 10 second duration 250 c esd stress on all pins 4 kv stresses beyond absolute maximum ratings may cause permanent damage to the device. these are stress ratings only and functional operation at these or any other conditions beyond those indicated under ?recommended operating conditions? is not implied. exposure to absolute - maximum - rated conditions for extended periods may affect device reliability. all voltages are with respect to gnda.
71m6521de/dh/fe data sheet page: 90 of 107 re v 2 recommended external components name from to function value unit c1 v3p3a agnd bypass capacitor for 3.3 v supply 0.1 20% f c2 v3p3d dgnd bypass capacitor for 3.3 v output 0.1 20% f csys v3p3sys dgnd bypass capacitor for v3p3sys 1.0 30% f c2p5 v2p5 dgnd bypass capacitor for v2p5 0.1 20% f xtal xin xout 32.768 khz crystal ? electrically similar to ecs .327 - 12.5- 17x or vishay xt26t, load capaci - tance 12.5 pf 32.768 khz cxs ? xin agnd load capacitor for crystal (exact value depends on crystal specifications and parasitic capaci - tance of board). 27 10% pf cxl ? xout agnd 27 10% pf ? depending on trace capacitance, higher or lower values for cxs and cxl must be used. capacitance from xin to gndd and xout to gndd (combining pin, trace and crystal capacitance) should be 35pf to 37pf. recommended operating conditions parameter condition min typ max unit 3.3v supply voltage ( v3p3sys, v3p3a ) v3p3a and v3p3sys must be at the same voltage normal operation 3.0 3.3 3.6 v battery backup 0 3.6 v vbat no battery externally connect to v3p3sys battery backup brn and lcd modes sleep mode 3.0 2.0 3.8 3.8 v v operating temperature - 40 +85 o c maximum input voltage on dio/seg pins configured as dio input. * mission mode brownout mode lcd mode v3p3sys+0.3 vbat+0.3 vbat+0.3 v v v *exceeding this limit will distort the lcd waveforms on other pins.
71m6521de/dh/fe data sheet re v 2 page: 91 of 107 performance specifications input logic levels parameter condition min typ max unit digital high - level input voltage ? , v ih 2 v digital low - level input voltage ? , v il 0.8 v input pull - up current, i il e_rxtx, e_rst, cktest other digital inputs vin=0 v, ice_e=1 10 10 - 1 0 100 100 1 a a a input pull down current, i ih ice_e pb other digital inputs vin=v3p3d 10 -1 - 1 0 0 100 1 1 a a a ? in battery powered modes, digital inputs should be below 0.3v or above 2. 5 v to minimize battery current. output logic levels parameter condition min typ max unit digital high - level output voltage v oh i load = 1 ma v3p3d ? 0.4 v i load = 1 5 ma v3p3d - 0.6 1 v digital low - level output voltage v ol i load = 1 ma 0 0.4 v i load = 1 5 ma 0.8 1 v opt_tx v oh ( v3p3d - opt_tx ) i source = 1 ma 0.4 v opt_tx v ol i sink =2 0 ma 0.7 1 v 1 guaranteed by design ; not production test ed . power - fault comparator parameter condition min typ max unit offset voltage v1 - vbias - 20 +15 mv hysteresis current v1 vin = vbias ? 100 mv 0.8 1.2 a response time v1 + 100 mv overdrive - 100 mv overdrive 2 10 5 10 100 s s wdt disable threshold ( v1 - v3p3a ) - 400 - 10 mv battery monitor bme=1 parameter condition min typ max unit load resistor 27 45 63 k lsb value - does not include the 9 - bit left shift at ce input. fir_len =0 fir_len =1 - 6.0 - 2.6 - 5.4 - 2.3 - 4.9 - 2.0 v v offset error - 200 - 72 +100 mv
71m6521de/dh/fe data sheet page: 92 of 107 re v 2 supply current parameter condition min typ max unit v3p3a + v3p3sys current normal operation, v3p3a=v3p3sys =3.3 v mpu_div=3 (614khz) ckout_e=00, ce_en=1, rtm_e=0, eck_dis=1, adc_e=1, ice_e=0 6.1 7.7 ma vbat current -300 +300 na v3p3a + v3p3sys current vs. mpu clock frequency same conditions as above 0.5 ma/ mhz v3p3a + v3p3sys current, w rite f lash normal operation as above, except write f lash at maximum rate, ce_e=0, adc_e=0 9.1 10 ma vbat current ? vbat=3. 6 v brownout mode, <25c brownout mode, > 2 5c lcd mode, 25c lcd mode, over temperature sleep mode, 25c sleep mode, over temperature 48 65 1 5.7 2.9 120 150 1 8.5 15 1 5.0 10 1 a a a a a a ? current into v3p3a and v3p3sys pins is not zero if voltage is applied at these pins in brownout, lcd or sleep modes. 1 guaranteed by design ; not production test ed . v3p3d switch parameter condition min typ max unit on resistance ? v3p3sys to v3p3d | i v3p3d | 1 ma 10 on resistance ? vbat to v3p3d | i v3p3d | 1 ma 40 2. 5 v voltage regulator unless otherwise specified, load = 5 ma parameter condition min typ max unit voltage overhead v3p3 - v2p5 reduce v3p3 until v2p5 drops 200mv 440 mv pssr ? v2p5/ ? v3p3 reset=0, iload=0 - 3 +3 mv/v low power voltage regulator unless otherwise specified, v3p3sys=v3p3a =0 , pb=gnd (brownout) parameter condition min typ max unit v2p5 i load =0 2.0 2.5 2.7 v v2p5 load regulation i load = 0 m a to 1 ma1 ma 30 mv vbat voltage requirement i load = 1 m a , reduce vbat until reg_lp_ok=0 3.0 v psrr v2p5 / vbat i load =0 - 50 50 mv/v
71m6521de/dh/fe data sheet re v 2 page: 93 of 107 crystal oscillator parameter condition min typ max unit maximum output power to crystal crystal connected 1 w xin to xout capacitance 3 pf capacitance to dgnd xin xout 5 5 pf pf vref, vbias unless otherwise specified, vref_dis =0 parameter condition min typ max unit vref output voltage, vnom(25) ta = 22oc 1.193 1.195 1.197 v vref chop step 50 mv vref output impedance vref_cal =1, i load = 10 a, - 10 a 2.5 k vnom definition 2 2 ) 22 ( 1 ) 22 ( ) 22 ( ) ( 2 tc t tc t vref t vnom ? + ? + = v -- if trimbga and trimbgb not available -- vref temperature coefficients tc1 tc2 +7.0 - 0.341 v/oc v/c 2 vref(t) deviation from vnom(t) ) 40 , 22 max( 10 ) ( ) ( ) ( 6 ? ? t t vnom t vnom t vref ta = - 40oc to +85oc -40 1 +40 1 ppm/oc -- if trimbga and trimbgb are available (71m6521dh) -- define the following variables: ??? ? 22 ,1 ???? _ ??? _ ? / 2 10 -- where temp_raw_x is measured with firlen=1 ??? ? 22 ,0 = ??? ? 22, 1 2 . 3704 -- this calculates the value of temp 22 if measured with firlen=0 ? = 0 . 1 ? ??????? ? 0 . 143 ? ( ????? + 0 . 5 ) ? = ??? ? 22 ,0 ? ( 500 ? ??????? + 370000 ) 900 ? = ( 56 . 2 ? ????? ) ? 0 . 55 vnom temperature coefficients ( v and t are defined in the section entitled ?voltage refer - ence?) tc1 tc2 ? + 19 ? ? 0 . 065 ?? + 0 . 34 ? + 8 . 0 0 . 015 ? ? 0 . 0013 ? ? 0 . 35 v/oc v/oc 2 vref(t) deviation from vnom(t) ) 40 , 22 max( 10 ) ( ) ( ) ( 6 ? ? t t vnom t vnom t vref ta = - 40oc to +85oc -2 0 1 + 2 0 1 ppm/oc vref aging 2 5 ppm/ year vbias voltage ta = 25oc ta = - 40oc to 85oc ( - 1%) ( - 4%) 1 1.6 1.6 1 (+1%) (+4%) 1 v v 1 guaranteed by design ; not production test ed . 2 this relationship describes the nominal behavior of vref at different temperatures.
71m6521de/dh/fe data sheet page: 94 of 107 re v 2 lcd drivers applies to all com and seg pins. parameter condition min typ max unit vlc2 max voltage with respect to vlcd - 0.1 +0 .1 v vlc1 voltage, 1/3 bias ? bias with respect to 2*vlc2/3 with respect to vlc2/2 -4 - 3 0 +2 % % vlc0 voltage, 1/3 bias ? bias with respect to vlc2/3 with respect to vlc2/2 -3 - 3 +2 +2 % % vlcd is v3p3sys in mission mode and vbat in brownout and lcd modes. adc converter, v3p3a referenced fir_len =0, vref_dis =0, lsb values do not include the 9 - bit left shift at ce input. parameter condition min typ max unit recommended input range (vin - v3p3a ) -250 250 mv peak voltage to current crosstalk: ) cos( * 10 6 vcrosstalk vin vin vcrosstalk ? vin = 200 mv peak, 65 hz, on va vcrosstalk = largest measurement on ia or ib -10 1 10 1 v/v thd (first 10 harmonics) 250mv -pk 20mv - pk vin=65 hz, 64 kpts fft, blackman - harris window -75 - 90 db db input impedance vin=65 hz 40 90 k temperature coefficient of input impedance vin=65 hz 1.7 /c lsb size fir_len =0 fir_len =1 357 151 nv/lsb digital full scale fir_len =0 fir_len =1 + 884736 2097152 lsb adc gain error vs %power supply variation 3 . 3 / 3 3 100 / 357 10 6 a p v v nv nout in pk ? ? vin=200 mv pk, 65 hz v3p3a=3.0 v, 3. 6 v 50 ppm/% input offset (vin - v3p3a ) - 10 10 mv 1 guaranteed by design ; not production test ed .
71m6521de/dh/fe data sheet re v 2 page: 95 of 107 temperature sensor parameter condition min typ max unit nominal sensitivity (s n ) ? t a =25oc, t a =75oc, fir_len = 1 nominal relationship: n(t)= s n *(t - t n )+n n - 2180 lsb/oc nominal (n n ) ? ? 1.0 10 6 lsb temperature error ? ? ? ? ? ? ? ? ? + ? ? = n n n t s n t n t err ) ) ( ( t a = - 40oc to +85oc tn = 25c -10 1 +10 1 oc 1 guaranteed by design ; not production test ed . ? lsb values do not include the 9 - bit left shift at ce input. ?? n n is measured at t n during meter calibration and is stored in mpu or ce for use in temperature calculations.
71m6521de/dh/fe data sheet page: 96 of 107 re v 2 timing specifications ram and flash memory parameter condition min typ max unit ce dram wait states ckmpu = 4.9 mhz 5 cycles ckmpu = 1.25 mhz 2 cycles ckmpu = 614 khz 1 cycles flash read pulse width v3p3a=v3p3sys=0 brownout mode 30 100 ns flash write cycles - 40c to +85c 20,000 cycles flash data retention 25c 100 years flash data retention 85c 10 years flash byte writes between page or mass erase operations 2 cycles flash memory timing parameter condition min typ max unit write time per byte 42 s page erase (512 bytes) 20 ms mass erase 200 ms eeprom interface parameter condition min typ max unit write clock frequency ( i 2 c ) ckmpu=4.9 mhz, using interrupts 78 khz ckmpu=4.9 mhz, ?bit - banging? dio4/5 150 khz write clock frequency (3 - wire) ckmpu=4.9 mhz 500 khz reset and v1 parameter condition min typ max unit reset pulse fall time 1 1 s reset pulse width 5 s 1 guaranteed by design ; not production test ed . rtc parameter condition min typ max unit range for date 2000 - 2255 year
71m6521de/dh/fe data sheet re v 2 page: 97 of 107 typical performance data figure 42 : wh accuracy, 0.1a to 200a at 240v/50hz and room temperature measured at current distortion amplitude of 40% and voltage distortion amplitude of 10%. figure 43 : meter accuracy over harmonics at 240v, 30a -0.5 -0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5 0.1 1 10 100 1000 current [a] error [%] phase_0 phase_60 phase_300 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 1 3 5 7 9 11 13 15 17 19 21 23 25 harmonic error [%] 50hz harmonic data 60hz harmonic data
71m6521de/dh/fe data sheet page: 98 of 107 re v 2 figure 44 : typical me ter accuracy over temperature relative to 25c (71m6521fe) package outline (lqfp 64) 11.7 12.3 0.60 typ. 1.40 1.60 11.7 12.3 0.00 0.20 9.8 10.2 0.50 typ. 0.14 0.28 pin no. 1 indicator + note: controlling dimensions are in mm package outline (qfn 68) relative accuracy over temperature -30 -20 -10 0 10 20 30 40 -60 -40 -20 0 20 40 60 80 100 temperature [c] accuracy [ppm/c]
71m6521de/dh/fe data sheet re v 2 page: 99 of 107 dimensions (in mm): symbol min. nom. max. comment e 0.4 bsc pin pitch (c - c) nd 17 pins per row ne 17 pins per column a 0.85 0.90 total height a1 0.00 0.01 0.05 a2 0.65 0.70 a3 0.20 ref b 0.15 0.20 0.25 pin width *) d 8.00 bsc total width d1 7.75 bsc d2 6.3 exposed pad **) e 8.00 bsc total length e1 7.75 bsc e2 6.3 exposed pad b 0.15 0.20 0.25 pad width p 0.24 0.42 0.60 45 corner 12 angle *) pin length is nominally 0.4mm (min. 0.3mm, max 0.4mm) **) exposed pad is internally connected to gndd.
71m6521de/dh/fe data sheet page: 100 of 107 re v 2 pinout (lqfp - 64) teridian 71m6521fe-igt gndd e_rxtx/seg38 opt_tx/dio2 tmuxout tx seg3 v3p3d cktest/seg19 v3p3sys seg4 seg5 seg37/dio17 com1 com0 com2 33 64 reset v2p5 vbat rx seg31/dio11 seg30/dio10 seg29/dio9 seg28/dio8 seg27/dio7 seg26/dio6 seg25/dio5 ice_e seg24/dio4 seg18 seg17 seg16 com3 seg0 seg35/dio15 seg36/dio16 seg6 seg8 seg1 seg2 seg34/dio14 seg7 seg12 seg10 seg11 seg9 seg15 seg13 seg14 e_tclk/seg33 va opt_rx/dio1 test gnda v3p3a e_rst/seg32 pb xout v1 xin x4mhz ia vb vref 1 17 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 24 23 25 26 27 28 29 30 31 32 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 ib pinout (qfn 68) gndd e_rxtx/seg38 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 opt_tx/dio2 tmuxout dio3 tx seg3 v3p3d cktest/seg19 v3p3sys seg4 seg5 seg37/dio17 com0 com1 com2 com3 seg0 seg1 seg2 seg34/dio14 seg35/dio15 seg36/dio16 seg39/dio19 seg6 seg7 seg8 seg9 seg10 seg11 seg12 seg13 seg14 seg15 seg16 seg17 seg18 ice_e seg24/dio4 seg25/dio5 seg26/dio6 seg27/dio7 seg28/dio8 seg29/dio9 seg30/dio10 seg31/dio11 seg40/dio20 rx vbat v2p5 reset gnda v3p3a va vb ib ia vref v1 opt_rx/dio1 x4mhz xin xout test pb e_rst/seg32 e_tclk/seg33 seg41/dio21 teridian 71m6521de - im
71m6521de/dh/fe data sheet re v 2 page: 101 of 107 recommended pcb land pattern for the qfn - 68 package recommended pcb land pattern dimensions symbol description typical dimension e lead pitch 0.4mm x pad width 0.23mm y pad length, see note 3 0.8mm d see note 1 6.3mm a 6.63mm g 7.2mm note 1: do not place unmasked vias in region denoted by dimension ?d?. note 2: soldering of bottom internal pad is not required for proper operation. note 3: the ?y? dimension has been elongated to allow for hand soldering and reworking. production assembly may allow this dimension to be reduced as long as the ?g? dimension is maintained.
71m6521de/dh/fe data sheet page: 102 of 107 re v 2 pin descriptions power/ground pins: name type circui t description gnda p -- analog ground: this pin should be connected directly to the ground plane. gndd p -- digital ground: this pin should be connected directly to the ground plane. v3p3a p -- analog power supply: a 3.3v power supply should be connected to this pin, must be the same voltage as v3p3sys. v3p3sys p -- system 3.3v supply. this pin should be connected to a 3.3v power supply. v3p3d o 13 auxiliary voltage output of the chip, controlled by the internal 3.3v selection switch. in mission mode, this pin is internally connected to v3p3sys. in brownout mode, it is internally connected to vbat. this pin is high impedance in lcd and sleep mode. vbat p 12 battery backup power supply. a battery or super - capacitor is to be connected between vbat and gndd. if no battery is used, connect vbat to v3p3sys. v2p5 o 10 output of the internal 2. 5 v regulator. a 0.1f capacitor to gnda should be connected to this pin. analog pins: name type circui t description ia, ib i 6 line current sense inputs: these pins are voltage inputs to the internal a/d converter. typically, they are connected to the outputs of current sensors. unused pins must be connected to v3p3a. va, vb i 6 line voltage sense inputs: these pins are voltage inputs to the internal a/d converter. typically, they are connected to the outputs of resistor dividers. unused pins must be connected to v3p3a or tied to the voltage sense input that is in use. v1 i 7 comparator input: this pin is a voltage input to the internal power - fail comparator. the input voltage is compared to the internal bias voltage (1. 6 v ). if the input voltage is above vbias, the comparator output will be high (1). if the comparator output is lower, a voltage fault will occur and the chip will be forced to battery mode. vref o 9 voltage reference for the adc. this pin is normally disabled by setting the vref_cal bit in the i/o ram and can then be left unconnected. if enabled, a 0.1f capac itor to gnda should be connected. xin xout i 8 crystal inputs: a 32khz crystal should be connected across these pins. typically, a 27pf capacitor is also connected from each pin to gnda. it is important to minimize the capacitance between these pins. see the crystal manufacturer datasheet for details. pin types: p = power, o = output, i = input, i/o = input/output the circuit number denotes the equivalent circuit, as specified under ?i/o equivalent circuits?.
71m6521de/dh/fe data sheet re v 2 page: 103 of 107 digital pins: name type circui t description com3, com2, com1, com0 o 5 lcd common outputs: these 4 pins provide the select signals for the lcd display. seg0?seg18 o 5 dedicated lcd segment output pins. seg24/dio4? seg31/dio11 i/o 3, 4, 5 multi - use pins, configurable as either lcd seg driver or dio. (dio4 = sck, dio5 = sda when configured as eeprom interface, wpulse = dio6, varpulse = dio7 when configured as pulse outputs). if unused, these pins must be con figured as outputs. seg34/dio14? seg37/dio17 i/o 3, 4, 5 multi - use pins, configurable as either lcd seg driver or dio. if unused, these pins must be configured as outputs. seg39/dio19? seg41/dio21 i/o 3, 4, 5 multi - use pins, configurable as lcd driver or dio (qfn 68 package only). if un used, these pins must be configured as outputs. e_rxtx/seg38 e_rst/seg32 i/o 1, 4, 5 multi - use pins, configurable as either emulator port pins (when ice_e pulled high) or lcd seg drivers (when ice_e tied to gnd). e_tclk/seg33 o 4, 5 ice_e i 2 ice enable. when zero, e_rst, e_tclk, and e_rxtx become seg32, seg33, and seg38 respectively. for production units, this pin should be pulled to gnd to disable the emulator port. this pin should be brought out to the pro gramming in ter face in order to cr eate a way for reprogramming parts that have the secure bit set. cktest/seg19 o 4, 5 multi - use pin, configurable as either clock pll output or lcd segment driver. can be en abled and disabled by ckout_en . tmuxout o 4 digital output test multiplexer. controlled by tmux [ 4:0]. opt_rx/dio1 i/o 3, 4, 7 multi - use pin, configurable as optical receive input or general dio. when con figured as opt_rx, this pin receives a signal from an external photo - detector used in an ir ser ial interface. if unused, this pin must be configured as an output or terminated to v3p3d or gndd. opt_tx/dio2 i/o 3, 4 multi - use pin, configurable as optical led transmit output, wpulse, rpulse, or general dio. when configured as opt_tx, this pin is capable of directly driving an led for transmitting data in an ir serial interface. if unused, this pin must be configured as an output or terminated to v3p3d or gndd. dio3 i/o 3, 4 dio pin (qfn 68 package only) reset i 3 this input pin resets the chip into a known state. for normal operation, this pin is connected to gndd. to reset the chip, this pin should be pulled high. no external reset circuitry is necessary. rx i 3 uart input. if unused, this pin must be terminated to v3p3d or gndd. tx o 4 uart output. test i 7 enables production test. must be grounded in normal operation. pb i 3 push button input. a rising edge sets the ie_pb flag and causes the part to wake up if it is in sleep or lcd mode. pb does not have an internal pull - up or pull - down. if unused, this pin must be terminated to gndd. x4mhz i 3 this pin must be connected to gndd. pin types: p = power, o = output, i = input, i/o = input/output the circuit number denotes the equivalent circuit, as specified on the following page.
71m6521de/dh/fe data sheet page: 104 of 107 re v 2 i/o equivalent circuits: digital input equivalent circuit type 1: standard digital input or pin configured as dio input with internal pull-up gndd 110k v3p3d cmos input v3p3d digital input pin cmos output gndd v3p3d gndd v3p3d digital output equivalent circuit type 4: standard digital output or pin configured as dio output digital output pin lcd output equivalent circuit type 5: lcd seg or pin configured as lcd seg lcd driver gndd lcd seg output pin to mux gnda v3p3a analog input equivalent circuit type 6 : adc input analog input pin comparator input equivalent circuit type 7: comparator input gnda v3p3a to comparator comparator input pin vref equivalent circuit type 9: vref from internal reference gnda v3p3a vref pin v2p5 equivalent circuit type 10: v2p5 from internal reference gndd v3p3d v2p5 pin vbat equivalent circuit type 12: vbat power gndd power down circuits vbat pin v3p3d equivalent circuit type 13: v3p3d from v3p3sys v3p3d pin from vbat 10 40 oscillator equivalent circuit type 8: oscillator i/o to oscillator gndd oscillator pin digital input type 2: pin configured as dio input with internal pull-down gndd 110k gndd cmos input v3p3d digital input pin digital input type 3: standard digital input or pin configured as dio input gndd cmos input v3p3d digital input pin
71m6521de/dh/fe data sheet re v 2 page: 105 of 107 ordering information part part description (package ) accuracy (ppm/c) flash memory size (kb) packaging ordering number package marking 71m6521de 64 - pin lqfp , lead(pb) - free 40 16 bulk 71m6521de - igt/f 71m6521de - igt 71m6521de 64 - pin lqfp , lead(pb) - free 40 16 tape & reel 71m6521de - igtr/f 71m6521de - igt 71m6521dh * 64 - pin lqfp, lead(pb) - free 20 16 bulk 71m6521dh - igt/f 71m6521dh - igt 71m6521dh * 64- pin lqfp, lead(pb) - free 20 16 tape & reel 71m6521dh - igtr/f 71m6521dh - igt 71m6521fe 64- pin lqfp , lead(pb) - free 40 32 bulk 71m6521fe - igt/f 71m6521fe - igt 71m6521fe 64 - pin lqfp , lead(pb) - free 40 32 tape & reel 71m6521fe - igtr/f 71m6521fe - igt 71m6521de 68 - pin qfn , lead(pb) - free 40 16 bulk 71m6521de - im/f 71m6521de -im 71m6521de 68 - pin qfn , lead(pb) - free 40 16 tape & reel 71m6521de - imr/f 71m6521de -im 71m6521fe 68 - pin qfn , lead(pb) - free 40 32 bulk 71m6521fe - im/f 71m6521fe -im 71m6521fe 68- pin qfn , lead(pb) - free 40 32 tape & reel 71m6521fe - imr/f 71m6521fe -im * future product ? contact factory for availability .
71m6521de/dh/fe data sheet page: 106 of 107 re v 2 revision history revision number revision date description pages changed 1.1 10/10 added the note ?guaranteed by design; not production tested.? to several performance specifications table parameters (v oh and v ol in the output logic levels table; vbat current in the supply current table; vref(t) deviation from vnom(t) and vbias voltage in the vref, vbias table; voltage to current crosstalk in the adc converter, voltage to current crosstalk v3p3a referenced table; temperature error in the te mperature sensor table) and timing specifications table parameters (reset pulse fall time in the reset and v1 table) 89? 93 changed the response time (v1) condition from 100mv overdrive to split +100mv and - 100mv overdrive conditions with new min and max numbers for - 100mv in the power - fault comparator table 89 added < 25 c and > 25 c to brownout mode in the vbat current parameter of the supply current table 90 changed the xin to xout capacitance parameter from 3pf (max) to 3pf (typ) and changed xin/xout for capacitance to dgnd from 5pf (max) to 5pf (typ) in the crystal oscillator table 91 changed the thd (first 10 harmonics) parameters for 250mv - pk and 20mv - pk from - 75db (max) and - 90db (max) to - 75db (typ) and - 90db (typ) in the adc converter, v3p3a referenced table 92 deleted the optical interface parameters table 93 2 1 1 / 1 1 added part type 71m6521dh all added description of 71m6521d h in hardware overview 10 added specification of temperature coefficients tc1/tc2 in electrical specifications for 71m6521dh 9 3 separated numbers from units by one space, e.g. 5 ma. all rephrased accuracy statement on title page (?up to 0.1% wh accuracy over 2,000:1 current range?). added 20 ppm/c for 71m6521dh. 1 added explanation of how tc1 and tc2 are generated for the 71m6521dh from the trimbga, trimbgb , trim , and trimt fuses. 61 corrected alt mux sequence in table 1 11 updated ordering information table (71m6521dh future product) . 105 added 71m6521 dh version to header . all added 71m6521dh to flash memory description. 39 changed trimm to trimm[2:0]. 6 1 added formula to convert tc1/tc2 to ppmc1/ppmc2. 61 added explanation of ?box? temperature concept. 61-62 added description of trimsel[3:0] and trim[7:0] to i/o ram description . 80 added vref(t) deviation from vnom(t) description for 71m6521dh in vref, vbias section. 93 added section explaining the distinction between 71m6521de/71m6521fe and 71m65 21 dh parts. 60
71m6521de/dh/fe data sheet maxim cannot assume responsibility for use of any circuitry other than circuitry entirely embodied in a maxim product. no cir cuit patent licenses are implied. maxim reserves the right to change the circuitry and specifications without notice at any time. maxim integrated products, 120 san gabriel drive, sunnyvale, ca 94086 408 - 737 - 7600 ? 2011 maxim integrated products is a registered trademark of maxim integrated products.


▲Up To Search▲   

 
Price & Availability of 71M6521DE-IGTF

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X